-->
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.  [ 9 posts ] 
Author Message
 Post subject: Same schema but different databases.
PostPosted: Mon Sep 25, 2006 3:00 am 
Newbie

Joined: Thu Aug 17, 2006 5:12 am
Posts: 2
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:

Mapping documents:

Code between sessionFactory.openSession() and session.close():

Full stack trace of any exception that occurs:

Name and version of the database you are using:

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:


Problems with Session and transaction handling?

Read this: http://hibernate.org/42.html

Hi,
i have un into a crazy problem. I have the same schema for three databases. So i have the only one Java Objects defined for a table even though it is replicated in the other dataases. When using the EnityManager outside a container this is no problem. However how do i go about it when using a container? Do i have to write seperate classes for each database or is there some other way of doing it?

_________________
Calvin- Happiness isn't enough for me. I demand euphoria!


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 25, 2006 4:48 am 
Expert
Expert

Joined: Sat Oct 25, 2003 8:49 am
Posts: 490
Location: Vrhnika, Slovenia
Hmm ... jar those domain classes and reference that jar within 3 different persistence.xml meta data files.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 25, 2006 7:26 am 
Newbie

Joined: Thu Aug 17, 2006 5:12 am
Posts: 2
U mean a single jar file but 3 persistence.xml files ?

_________________
Calvin- Happiness isn't enough for me. I demand euphoria!


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 25, 2006 7:36 am 
Expert
Expert

Joined: Sat Oct 25, 2003 8:49 am
Posts: 490
Location: Vrhnika, Slovenia
Single domain POJO jar and 3 ejb3 persistence jars - each referencing that domain jar as jar of entities.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 27, 2006 6:16 am 
Newbie

Joined: Wed Sep 27, 2006 6:12 am
Posts: 3
Can u please explain what do you mean by ejb3 persistence jars? Can u give an example for the same..


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 27, 2006 7:20 am 
Expert
Expert

Joined: Sat Oct 25, 2003 8:49 am
Posts: 490
Location: Vrhnika, Slovenia
Ever worked/deployed new ejb3 app (simple conf, no triple schema, ...)?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 27, 2006 10:23 pm 
Newbie

Joined: Wed Sep 27, 2006 6:12 am
Posts: 3
yes, I have made EJB3 applications but that were using only 1 persistence.xml


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 28, 2006 2:52 am 
Expert
Expert

Joined: Sat Oct 25, 2003 8:49 am
Posts: 490
Location: Vrhnika, Slovenia
So what's the problem then - simply triple what you did - but just with one domain jar - which is referenced in persistence.xml.

app.ear
- domain.jar (entities)
- ejb1.jar (META-INF/persistence.xml)
- ejb2.jar (META-INF/persistence.xml)
- ejb3.jar (META-INF/persistence.xml)

Ok, if persistence.xml doesn't suppport referencing jars as entites - I know H3 does - so you can use orm.xml to do that.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 29, 2006 4:56 am 
Newbie

Joined: Wed Sep 27, 2006 6:12 am
Posts: 3
Ok Thanks...i ll try out the same and get back to you.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 9 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.