-->
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: Multiple Databases..
PostPosted: Fri Jan 26, 2007 3:29 pm 
Newbie

Joined: Fri Jan 26, 2007 3:04 pm
Posts: 1
New to the forum.

I can't find the exact what I am looking for in the forum.

I have a requirement for multiple databases with same schema. "I have also read that I have to implement multiple session factory".

Here's what I tried:

I created another hibernate2.cfg.xml. When I call to get new session() which further calls

public Session getSession() {
return HibernateSessionFactory.getSession();
}

Even if I set the new config file or change the static String configFile value to "hibernate2.cfg.xml". It some how still goes to the default "hibernate.cfg.xml" only.

setConfigFile("/hibernate2.cfg.xml");
configuration.configure(configFile);
sessionFactory = configuration.buildSessionFactory();

Can someone please let me know how I should implement this. Can I get a sample code of hibernate.properties ?

Thanks..


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 02, 2007 11:33 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
please use the regular user forum

_________________
Emmanuel


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.