Skip to content

PersistenceAnnotationBeanPostProcessor fails to find EMFBs [SPR-3434] #8117

@spring-projects-issues

Description

@spring-projects-issues

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:

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions