-->
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.  [ 8 posts ] 
Author Message
 Post subject: Can hibernate support multiple data source?
PostPosted: Fri Aug 29, 2003 11:31 am 
Newbie

Joined: Fri Aug 29, 2003 11:15 am
Posts: 5
Hi,

My project need to handle one oracle and one DB2, it is easy to config two data source in WAS, but I don't know how to config in hibernate, and does hibernate support this function?


Regards,
Gao Kai


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 29, 2003 4:10 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
just create two SessionFactorys.


Top
 Profile  
 
 Post subject: Re:
PostPosted: Sat Aug 30, 2003 12:32 am 
Newbie

Joined: Fri Aug 29, 2003 11:15 am
Posts: 5
So, how to handle the transaction between these two data source (SessionFactory)?

Regards,
Gao Kao


Top
 Profile  
 
 Post subject:
PostPosted: Sat Aug 30, 2003 12:33 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
It is you appservers responsibility to handle transactions accross two datasources. JTA does this.


Top
 Profile  
 
 Post subject: to gaokai
PostPosted: Sun Aug 31, 2003 1:54 pm 
Newbie

Joined: Sun Aug 31, 2003 1:19 pm
Posts: 3
hi gao kai:

Are you Chinese? Our team use hibernate in a big case, maybe we have the same problems concerned, welcome discuss with us. :)

_________________
you know, programming is art ...


Top
 Profile  
 
 Post subject: to gaokai;foxding
PostPosted: Sun Aug 31, 2003 10:23 pm 
Newbie

Joined: Fri Aug 29, 2003 3:58 am
Posts: 4
I am Chinese too!

Welcome discuss !

E-MAIL,MSN:crpp88@hotmail.com


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 04, 2003 8:35 am 
Expert
Expert

Joined: Thu Sep 04, 2003 8:23 am
Posts: 368
gavin wrote:
just create two SessionFactorys.


And is it possible to define links between objects managed by two different session factories ?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 04, 2003 10:46 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 3:00 pm
Posts: 1816
Location: Austin, TX
I don't think so...

Another option I have used before is to define links between the two databases in the database itself (assuming your database supports this). In Oracle this is called a DATABASE LINK, oddly enough. Sybase/SQLServer do support this, also, but I can't remember what they call it.


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