Hi,
This is regarding the statement in JPA specification,
A persistence unit must have a name. Only one persistence unit of any given name must be defined
within a single EJB-JAR file, within a single WAR file, within a single application client jar, or within an EAR. See Section 8.2.2, “Persistence Unit Scope”.
...
...
A persistence unit that is defined at the level of an EJB-JAR, WAR, or application client jar is scoped to that EJB-JAR, WAR, or application jar respectively and is visible to the components defined in that jar or war.
A persistence unit that is defined at the level of the EAR is generally visible to all components in the application.
I am trying to understand how do you define a persistent
unit at the ear level as opposed to a PU at application jar level. As I understand, an ear can contain jars and wars. So a PU defined in a jar file that is contained in an ear (e.g. /lib/somejar.jar ), is considered as defined as application jar level or ear level?
I think am confused between application jar, ejb-jar and a regular jar. Is there a difference between these? A jar file containing ejbs is ejb-jar, isn't it? so if a PU is defined in an ejb-jar, would it be considered as "ear" level? What would be a regular jar?
Sorry, I am totally confused about this and would appreciate any help !