This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Functional Reactive Programming and have Stephen Blackheath and Anthony Jones on-line!
See this thread for details.
Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

mysql replication and hibernate

 
Girish Vasmatkar
Ranch Hand
Posts: 201
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

Has anyone done the mysql replication and used hibernate in the application? I am working on a fairly large web site that requires us to use mysql replication. I was wondering how hibernate handles mysql replication.

Do I have to change the code accordingly and specify some configuration information to hibernate to use mysql replication? I am also using spring in the application.

I have searched a lot regarding this subject and could not find any concrete information.



 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hibernate doesn't do anything to support this. It will use whatever connections you configure it to use. If your database supports clustering its down to the driver to provide a mechanism to failover to another node. A quick glance at the MySQL docs suggests the ReplicationDriver is what you need.
 
Girish Vasmatkar
Ranch Hand
Posts: 201
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Paul, thanks for the quick reply!!

A quick glance at the MySQL docs suggests the ReplicationDriver is what you need


So, does that mean simply specifying the ReplicationDriver will do the job? And all the replication configuration will be done at mysql end only?

Thanks again!!
 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Paul's right. You'll use Hibernate for your object relational mapping within your application, but replication is really a job that's best done by the database itself. That type of functionality is built into the database for you.

-Cameron McKenzie
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic