-->
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: Separate read/write databases
PostPosted: Tue Nov 30, 2010 6:03 am 
Newbie

Joined: Tue Nov 30, 2010 5:57 am
Posts: 5
Hi all,

I've tried Googling and searching the forums for this, but can't find any satisfactory answers.

How exactly does one specify that all write transactions go to one datasource, and all read transactions go to another in Hibernate?

I'm writing a Java webapp that needs to be easily horizontally scaled in a cloud environment. We'll be using MySQL, with the master being used for writes and a series of slaves for reads, which I believe is a pretty common usage model. When we need to scale the appserver tier, we'll be using EHCache as a 2L cache for Hibernate.

I gather setting up two session factories is one approach, but is there a 'transparent' way that I can get Hibernate to redirect writes/reads through config, instead of my code having to make the decision itself?

Thanks in advance for any help.


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.