This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
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.
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.
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.