aspose file tools*
The moose likes Object Relational Mapping and the fly likes mysql replication and hibernate Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "mysql replication and hibernate" Watch "mysql replication and hibernate" New topic
Author

mysql replication and hibernate

Girish Vasmatkar
Ranch Hand

Joined: Apr 24, 2008
Posts: 199
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

Joined: Apr 14, 2004
Posts: 10336

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.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Girish Vasmatkar
Ranch Hand

Joined: Apr 24, 2008
Posts: 199
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

Joined: Aug 26, 2006
Posts: 4968
    
    1

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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: mysql replication and hibernate
 
Similar Threads
Waht is Replication in mysql?
Using Hibernate for developing Information System in Java
Hibernate with MySql or MS Acess in Standalone Application ?
Is JSF, Hibernate 3 and Spring 2.5 integration good
JBoss DBCP