Hitachi

uCosminexus Application Server Compatibility Guide


8.9 Allocating persistence.xml

You allocate persistence.xml in the EJB-JAR, WAR, or EAR. Make sure that you place persistence.xml under META-INF. The path with persistence.xml under META-INF is called the persistence unit root.

The locations in which persistence.xml can be allocated are as follows:

You can define multiple persistence units in one persistence.xml. You must name the persistence unit. However, you cannot define multiple persistence units with duplicated names in one EJB-JAR, WAR, or EAR.

The class managed with the persistence unit defined in EAR is loaded using the application class loader and can be referenced from all the components in the application.

Furthermore, when the same entity class is referenced from the components in different EJB-JAR and WAR, the referenced class is the same unique class even if the persistence units are different.