Community
Participate
Working Groups
Created attachment 208037 [details] project with test case and launch config Gemini JPA keeps a reference to a single EntityManagerFactory from the underlying PersistenceProvider in the PUnitInfo. This is used by EMFBuilderServiceProxyHandler to return an already created EntityManagerFactory. Thus, if the method is called a second time with a different set of properties it returns the previously created EMF which may point to the wrong EclipseLink session. There is some verification being done in verifyJDBCProperties but that only verifies 'javax.persistence.jdbc.driver' and 'javax.persistence.jdbc.url' but not the EclipseLink session or DataSource. IMHO the contract of EntityManagerFactoryBuilder.createEntityManagerFactory(Map) does not state that only one EMF can be used. Thus, I think it's a valid use case to call this multiple time with different properties to create different EMFs.
*** This bug has been marked as a duplicate of bug 352708 ***