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 will Hibernate supports multiple database?
PostPosted: Tue Apr 10, 2007 1:15 am 
Newbie

Joined: Tue Apr 10, 2007 1:08 am
Posts: 2
Hi All,

Can any one please tell me hoe the hibernate will support multiple database in a single application?

As there is only one session factory for one database. How to create more session factories in the configuration file?

Thanks in advance.

-
Girish


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 10, 2007 8:51 am 
Expert
Expert

Joined: Tue Jul 11, 2006 10:21 am
Posts: 457
Location: Columbus, Ohio
There are several overloaded configure() methods in the Configuration object.

For example:

Code:
sessionFactory1 = new Configuration().configure("hibernate1.cfg.xml").buildSessionFactory();
sessionFactory2 = new Configuration().configure("hibernate2.cfg.xml").buildSessionFactory();


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.