SteveMc wrote:
You'll have to set up two session factories, and specify which one to use when loading objects. Writing any changes will be tricky (collections in particular don't like being moved between sessions), but I wouldn't advise writing anything to your master server that you've read from the slave.
Are you sure? Can anybody confirm this?
I mean, why do I configure the MySQL Replication Driver in hibernate.cfg.xml like this, with the master and the slave host?
Code:
<property name="connection.driver_class">com.mysql.jdbc.ReplicationDriver</property>
<property name="connection.url">jdbc:mysql://192.168.178.40:3306,192.168.178.49:3306/mydb?autoReconnect=true</property>