-->
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: hibernate and working with multiple databases
PostPosted: Wed Jun 24, 2009 12:49 pm 
Newbie

Joined: Fri Mar 11, 2005 11:18 am
Posts: 8
I prototype a simple hobby web application where a user can create many companies
but each company will have it's own database schema

So a user may choose to work on company X and another user can choose at login time to work on company Y
Number of companies are dynamic since anytime a new company may be created.

So each company will have it's own schema (companyX,companyY...)

Now on server side how can i manage multimple session factories ?

In servlet do i have to identify the company then to attach create a session factory that will be used how ????

THX any link or advice is welcomed


Top
 Profile  
 
 Post subject: Re: hibernate and working with multiple databases
PostPosted: Wed Aug 26, 2009 7:14 pm 
Regular
Regular

Joined: Tue Feb 19, 2008 6:05 pm
Posts: 82
Isn't a sessionFactory pool or a hashMap that returns you the correct sessionFactory based on the key which would be the company good enough to get a session and solve the problem of handling many schemas or databases?

Somebody correct me if I am wrong here, everything including ThreadLocal and session access would remain the same!

Cheers
Krishna


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.