-->
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: Single SessionFactory with multiple data sources
PostPosted: Thu May 11, 2006 4:38 am 
Newbie

Joined: Thu Nov 25, 2004 11:44 am
Posts: 15
Location: Woodbridge UK
Has anyone tried implementing a single SessionFactory with multiple data sources?

Here's my use case:
When clients log on, they are associated with one of several databases. Each of these databases has exactly the same structure, but obviously can contain different data. Any reads or updates made will be to the single database. There is no requirement to update multiple databases in the same transaction.

In JDBC terms, I need multiple DataSources. Since the structure of each of the database is identical, there should only be a single SessionFactory.

My understanding is that this should work if only the primary (transaction-scoped ) cache is used, because by definition each will apply to a single transaction. It could also work for the second level cache if this contains read only data, because even if Hibernate only has one second level cache per session factory, the read only data for each of the databases should be the same.

Are there any other gotchas that I am missing, restrictions I should apply to allow this configuration to work reliably?


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.