-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: Two databases, two persistence-units but one entity jar-file
PostPosted: Tue Jan 23, 2007 9:19 am 
Newbie

Joined: Tue Jan 23, 2007 6:16 am
Posts: 3
Hi all,

I'm trying to create two different database schemas from one entity jar-file. The point is that I need one DB for the actual data and exactly identical DB for backup purposes etc. My operative DB works just fine and all tables are created, but the problem is that my backup DB remains empty without any errors from Hibernate. I get no tables, no errors, no warnings and nothing seems to be wrong in log-files either. The other DB just remains empty.

Log-file is identical with both of these persistence-units. Hibernate tells me that this-n-that table not found in database etc and it leads to table creation in my operative database, like it should be. Nothing, absolutely nothing, happens to my backup persistence-unit.

I have JBoss 4.0.5.GA and Hibernate 3.2.1.GA. Both databases are empty and listed in deploy/postgres-ds.xml and they do exist before JBoss launch. My app is packed inside an EAR and my EJB-module has this persistence.xml listed below.

My persistence.xml:
<persistence-unit name="my-operative-db">
<jta-data-source>java:/my-operative-db</jta-data-source>
<jar-file>../entity-data.jar</jar-file>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect" />
<property name="hibernate.hbm2ddl.auto" value="update" />
<property name="hibernate.max_fetch_depth" value="0" />
<property name="hibernate.show_sql" value="true" />
<property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup" />
<property name="hibernate.transaction.factory_class" value="org.hibernate.transaction.CMTTransactionFactory" />
</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>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect" />
<property name="hibernate.hbm2ddl.auto" value="update" />
<property name="hibernate.max_fetch_depth" value="0" />
<property name="hibernate.show_sql" value="true" />
<property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup" />
<property name="hibernate.transaction.factory_class" value="org.hibernate.transaction.CMTTransactionFactory" />
</properties>
</persistence-unit>

Does any one have similar problems? Am I missing something or is there something wrong in Hibernate? Some one please try this out and post your comments.

Thanks for advance,
Ville


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 24, 2007 5:05 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
It might be a bug in JBoss EJB 3.0, ignoring subsequent PU loads, try to post on the JBoss EJB3 forum and open a JIRA issue

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 25, 2007 3:18 am 
Newbie

Joined: Tue Jan 23, 2007 6:16 am
Posts: 3
Thanks for your reply Emmanuel, I'll post this issue to the JBoss forum and JIRA as you suggested. Lets see if it helps.


Top
 Profile  
 
 Post subject: Two databases, two persistence-units but one entity jar-file
PostPosted: Fri Feb 02, 2007 10:12 am 
Newbie

Joined: Tue Jan 23, 2007 6:16 am
Posts: 3
Hi again,

Unfortunately this issue is still open. Has any of you Hibernate users experienced similar problems? Some solution suggestions perhaps...

This problem is also discussed in JBoss forums, but no luck yet.
JBoss forum topic can be found here.

Regards,
Ville Ingman


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.