mirror of
https://github.com/spring-projects/spring-framework.git
synced 2026-09-20 12:19:16 +00:00
Avoid scoped destruction callbacks in case of no post-processor actually applying
Issue: SPR-13744
This commit is contained in:
+5
@@ -375,6 +375,11 @@ public class PersistenceAnnotationBeanPostProcessor
|
||||
EntityManagerFactoryUtils.closeEntityManager(emToClose);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean requiresDestruction(Object bean) {
|
||||
return this.extendedEntityManagersToClose.containsKey(bean);
|
||||
}
|
||||
|
||||
|
||||
private InjectionMetadata findPersistenceMetadata(String beanName, final Class<?> clazz, PropertyValues pvs) {
|
||||
// Fall back to class name as cache key, for backwards compatibility with custom callers.
|
||||
|
||||
Reference in New Issue
Block a user