Hibernate "HHH000436 : Entity manager factory name (xyz) is already registered" in Application running against EAP
Issue
I'm encountering the following log message in a client application:
14/10/17 13:20:25.010 WARN (main) [org.hibernate.ejb.internal.EntityManagerFactoryRegistry.addEntityManagerFactory:80] HHH000436: Entity manager factory name (xyz) is already registered. If entity manager will be clustered or passivated, specify a unique value for property 'hibernate.ejb.entitymanager_factory_name'
We recently migrated from EAP 5 (where we did not encounter this warning) to EAP 6.
As the message indicates, the application is creating an EntityManagerFactory for the same persistence unit more than once.
Here is the code that is being repeated:
entityManagerFactory = Persistence.createEntityManagerFactory(persistenceUnitName);
entityManager = entityManagerFactory.createEntityManager();
Could this message be logged only once? Or suppressed perhaps?
Environment
Red Hat JBoss Enterprise Application Platform (EAP) 6
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
