Share persistence units between ejb-jars

From Thorgull
Jump to: navigation, search


You have an ear package with multiple ejb packages inside and many of the ejb' packages need to access the same datasource.


  • Create a persistence.jar package which will contains only the persistence.xml file.
  • Put this jar in the lib directory of the ear package.
  • Add the following block to the application.xml descriptor