-
1. Re: Two databases, two persistence-units but one entity jar-
dkalna Jan 25, 2007 6:49 AM (in response to ville-ingman)Hi Ville,
I think you have to explicitly specify your Entities in persistence.xml, otherwise they will deployed to "default" = first one, only.
<persistence-unit name=" my-operative-db ">
<jta-data-source> java:/my-operative-db </jta-data-source>
<jar-file> ../entity-data.jar </jar-file>
com.yourhost.domain.Entity1
com.yourhost.domain.Entity2
<properties...
</persistence-unit>
<persistence-unit name=" my-backup-db ">
<jta-data-source> java:/my-backup-db </jta-data-source>
<jar-file> ../entity-data.jar </jar-file>
com.yourhost.domain.Entity1
com.yourhost.domain.Entity2
<properties...
</persistence-unit>
Bye
Dalibor -
2. Re: Two databases, two persistence-units but one entity jar-
dkalna Jan 25, 2007 6:53 AM (in response to ville-ingman)oooops, correction, these have to be inside element:
com.yourhost.domain.Entity1
com.yourhost.domain.Entity2
Dalibor -
3. Re: Two databases, two persistence-units but one entity jar-
dkalna Jan 25, 2007 6:55 AM (in response to ville-ingman)sorry, he is not showing class XML element...
-
4. Re: Two databases, two persistence-units but one entity jar-
ville-ingman Jan 25, 2007 7:20 AM (in response to ville-ingman)Thanks for your reply Dalibor,
I'm afraid that listing all my entities is not an option for me in this project I'm working on. My entity-jar contents is not for me to decide and there are dynamically generated class-files included in these jar-files etc.
So. The only way I can make this happen is to use <jar-file> -tag and the runtime environment JBoss+Hibernate take care of the rest. I just need a backup database that is an identical copy of my operative database and entity modifications are published to these two databases. Nothing more, nothing less.
Unfortunately this issue is still open. More ideas from you Dalibor or someone else?
As far as I'm concerned, this is a bug in JBoss+Hibernate combination. Could someone in the JBoss team check this out and see if a JIRA issue have to be raised?
Thanks for advance for more comments on this,
Ville -
5. Re: Two databases, two persistence-units but one entity jar-
ville-ingman Feb 2, 2007 9:05 AM (in response to ville-ingman)Hi again,
Unfortunately this issue is still open. Has some one checked this out yet?
Regards,
Ville Ingman -
6. Re: Two databases, two persistence-units but one entity jar-
alrubinger Feb 2, 2007 1:02 PM (in response to ville-ingman)Looks like:
http://jira.jboss.com/jira/browse/EJBTHREE-560
...you can watch or vote on it :)
S,
ALR