How can I share a Persistence Unit across modules in EAP 6?
Issue
Currently we are using JBoss EAP 4.2 and have a shared persistence unit component (contains Entities, DAO and persitence.xml) which is shared (accessible) by other deployed jars and wars.
When we try to migrate to EAP 6.1, we put our persistence unit as one module. For example:
deployment/persistence.jar
deployment/one.jar
deployment/two.jar
In this case, one.jar and two.jar could not access the EntityManager defined in persistence.jar.
Could you please let us know what is best practice for deploying and sharing Persistence Unit across modules? We don't want to avoid EAR because our system is really complicated and 1 EAR deployment won't work for us.
Environment
- Red Hat JBoss Enterprise Application Platform (EAP)
- 6.1.0
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.
