-->
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.  [ 2 posts ] 
Author Message
 Post subject: How to use hibernate to handle 2 databases at same time
PostPosted: Tue Sep 05, 2006 7:28 am 
Newbie

Joined: Tue Sep 05, 2006 7:23 am
Posts: 1
I have a scenario

lets say my application wants to use 2 databases MySQL & Oracle.
I have x tables in MySQL & y in Oracle.

How will i be able to create two sessionFactories in either applicationContext.xml or hibernate_cfg.hxl.

will following snippet work


<!-- Hibernate SessionFactory -->
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
</bean>

<bean id="sessionFactoryO" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
</bean>


Top
 Profile  
 
 Post subject: It should work
PostPosted: Tue Sep 05, 2006 9:24 am 
Regular
Regular

Joined: Wed Aug 24, 2005 11:49 am
Posts: 63
If you specify different properties for each session factory (eg. different configLocation, datasource etc.) it should work.


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