-->
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.  [ 7 posts ] 
Author Message
 Post subject: MySQL master/slave replication and Hibernate?
PostPosted: Mon Aug 06, 2007 6:00 pm 
Beginner
Beginner

Joined: Thu Oct 16, 2003 7:25 pm
Posts: 38
Location: New York City
Our operations group was asked by my manager to spend time puttting together a MySQL master/slave replication "cluster". Now, I'm stuck with the task of configuring our already completed system to work with the cluster, and I seem to have only roadblocks in my path.

I have tried calling session.connection().setReadOnly(true/false) at the appropriate times, but Hibernate seems to fail on write ops even when I've setReadOnly to false; it seems like it has amnesia.

I've also tried with the "hibernate.connection.failOverReadOnly" configuration property set to true. All requests in this case go to the master, and the slaves are unused.

Has anyone successfully integrated a MySQL master/slave cluster with Hibernate? If so, what changes to your code or config did you need to make? I'd like to know, and soon.

Thanks,
Tom
thomas (dot) harris (at) sourcemedia (dot) com

Hibernate version: 3.2.5GA, Annotations 3.3.0GA, Entity 3.3.1GA, Validator 3.3.0GA

Mapping documents: None, annotations.

Name and version of the database you are using: MySQL 5.0.45


Top
 Profile  
 
 Post subject: Re: MySQL master/slave replication and Hibernate?
PostPosted: Wed Sep 03, 2008 2:27 pm 
Newbie

Joined: Wed Sep 03, 2008 1:05 pm
Posts: 2
Location: Los Angeles
I am also in the process of setting up MySQL master/slave replication with Hibernate.

Did you ever find a good solution for the configuration of hibernate with MySQL master/slave replication?

Thank you.


Top
 Profile  
 
 Post subject: Re: MySQL master/slave replication and Hibernate?
PostPosted: Wed Sep 03, 2008 2:28 pm 
Newbie

Joined: Wed Sep 03, 2008 1:05 pm
Posts: 2
Location: Los Angeles
Duplicate post.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 03, 2008 7:40 pm 
Beginner
Beginner

Joined: Wed Apr 20, 2005 9:30 am
Posts: 39
I could be mistaken, but I think this is a job for Shards...

Cheers,

J --


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 04, 2008 7:26 pm 
Beginner
Beginner

Joined: Thu Oct 16, 2003 7:25 pm
Posts: 38
Location: New York City
I no longer work there, but, we wound up using the comma-separated configuration for the driver's host setting and starting off each server pointing at a distinct member of the db cluster.

Shards wasn't available when I was going through this, and it's too late for me now anyway. I'll pass on the info to the old team, whoever's left.

Tom


Top
 Profile  
 
 Post subject: Re: MySQL master/slave replication and Hibernate?
PostPosted: Thu Dec 12, 2013 2:03 am 
Newbie

Joined: Thu Dec 12, 2013 1:53 am
Posts: 2
Let me know if any one configured


Top
 Profile  
 
 Post subject: Re: MySQL master/slave replication and Hibernate?
PostPosted: Wed Dec 18, 2013 8:18 am 
Newbie

Joined: Thu Dec 12, 2013 1:53 am
Posts: 2
Configure mysql server as master slave
just add ((SessionImpl)session).connection().setReadOnly(true);
before reading the data


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 7 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.