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.  [ 1 post ] 
Author Message
 Post subject: One webapp with multiple databases (and session factories)
PostPosted: Tue May 18, 2010 2:50 pm 
Newbie

Joined: Wed Aug 08, 2007 11:28 pm
Posts: 4
We have a requirement that is really begging that each customer have it's own database. All the databases
will have an identical schema. We would, of course, need to have a session factory configured for each
database. However, there could be upward of 100 separate databases. Ideally, having all 100 session
factories build on system startup makes things easy programatically. However, I'm concerned about needless
overhead.

Because of this, I'm leaning toward keeping a pool of Session Factories and only creating them when needed,
e.g. when a user needs to access their database (typically on login) it will create that session factory
and add it to a "pool."

I've read through some forums in various locations and some suggest it's a bad idea to have more than
one session factory. Hibernate supports it. I am concerned about the memory overhead and # of connections
to the database. At first I think the pool for each would be 2-4 connections each. I realize this means
that with 100 databases this is 400 connections and I'm not comfortable with that.

Does anybody have any thoughts on this one way or another?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.