-
Notifications
You must be signed in to change notification settings - Fork 38.7k
Description
Barry Kaplan opened SPR-3434 and commented
The changes from 2.0.3 to 2.0.4 has cause some side effects. In 2.0.3 the PABPP would use beanFactory.getBean(..) to obtain the EMFs. In 2.0.4 it first beanFactory.isTypeMatch(..)
When the EMF has not yet been created in the context, AbstractEntityMangagerFactoryBean.getObjectType will return EntityManagerFactory.class, but PABPP compares the class against EntityManagerFactoryInfo.class. Hence due the abitrary ordering of bean creation most of my EMFs fail to be discovered by the PABPP.
PABPP.findNamedEntityManagerFactory(..) returns EntityManagerFactory (not EMFInfo), so why does it check for the EMFInfo.class?
I cannot simply have PABPP depend on the LCEMFBs because it defined in a generic config file, where the LCEMFBs are defined in component specific config files.
Affects: 2.0.4
Issue Links:
- PersistenceAnnotationBeanPostProcessor fails to match unitName of lazy loaded EMFs in some cases [SPR-3370] #8054 PersistenceAnnotationBeanPostProcessor fails to match unitName of lazy loaded EMFs in some cases ("duplicates")