-
1. Re: duplicate persistence unit in same EAR
wdfink Nov 4, 2010 3:42 AM (in response to asookazian)I use ATM JBoss 4.3 to migrate to EJB.
I have also some found some problems with persistence units,
- difficult autoimatic detection of entity classes
- problems with the naming (like you have) and that the units must be unique named
Also the bhaviour has changed in JBoss 5x
So in fact I'm also a bit unsteady about this.
-
2. Re: duplicate persistence unit in same EAR
asookazian Nov 4, 2010 11:26 PM (in response to wdfink)I'm assuming it's ok as per JSR220 (or JPA 1.0 spec), etc. to allow multiple persistence units with the same name in the same EAR. Otherwise, this is erroneous behavior from JBoss.
What I'd like to know is how JBoss handles this scenario (i.e. are just one or both of the PUs actually used, etc.)?
-
3. Re: duplicate persistence unit in same EAR
jaikiran Nov 5, 2010 2:06 AM (in response to asookazian)Arbi Sookazian wrote:
I'm assuming it's ok as per JSR220 (or JPA 1.0 spec), etc. to allow multiple persistence units with the same name in the same EAR. Otherwise, this is erroneous behavior from JBoss.
Multiple persistence units with same name are allowed. But which one gets used depends on "where" it's being used. The JPA2 (or even JPA1 spec) has a section named "Persistence Unit Scope" which has the complete details.