On our server we have one EJB3 persistence unit (unit1.jar) up and running.
Now we need to deploy a newer version of the persistence unit so that a new version of our web-application can use new features on the persistence layer.
We also need to keep previous version, so that the old application did not get broken.
To achive that we build a jar with a different name (unit2.jar) and gave a different name to the persistence unit in persistence.xml:
Code:
persistence-unit name="unit2"
and different jndi-name in jboss.xml:
Code:
<jndi-name>unit2/myDAO/remote</jndi-name>
Though, we have not changed ejb-name, using the same as in unit1
Code:
<ejb-name>myDAO</ejb-name>
When we deploy unit2.jar we get exception:
org.hibernate.AnnotationException "Use of the same entity name twice"
Please give as an advice how to overcome this issue or point to a source where I can read about this.
Thanks