-->
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: how to use 2 database connections within one application
PostPosted: Tue Apr 13, 2004 12:36 pm 
Newbie

Joined: Fri Apr 02, 2004 9:18 am
Posts: 5
Location: Cologne, Germany
Hello,

How can I use 2 database connections within one application using Hibernate 2.1? If I need a configuration for a class ClassA with a mapping to table_A in database A and ClassB with a mapping to table_B in database B using different JDBC connections.
Neither is B part or subclass of A nor vice versa.

Thanx for any help.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 13, 2004 12:46 pm 
Beginner
Beginner

Joined: Mon Mar 08, 2004 5:22 pm
Posts: 35
Create two sessions


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 13, 2004 2:03 pm 
Beginner
Beginner

Joined: Fri Feb 27, 2004 11:47 am
Posts: 24
create two hibernate.properties specify two different connections in each file and use two sessions

_________________
Web Developer


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 13, 2004 6:24 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Thats all close, but what you really want is two Configurations (two config files probably) and two SessionFactories.

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


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.