Connector/J Load Balancing in Master/Slave Environment
Posted by: William Bailey
Date: July 30, 2012 09:35AM

According to the Connector/J documentation, the driver is intelligent enough to make sure that all JDBC operations within a given transaction are executed against the same server (i.e. it doesn't swap servers during the transaction). To be completely clear, here is the section from the documentation.

---
When trying to balance workload between multiple servers, the driver has to determine when it is safe to swap servers, doing so in the middle of a transaction, for example, could cause problems. It is important not to lose state information. For this reason, Connector/J will only try to pick a new server when one of the following happens:

1) At transaction boundaries (transactions are explicitly committed or rolled back).

2) A communication exception (SQL State starting with "08") is encountered.

3) When a SQLException matches conditions defined by user, using the extension points defined by the loadBalanceSQLStateFailover, loadBalanceSQLExceptionSubclassFailover or loadBalanceExceptionChecker properties.
---

This is good news for us, but I wanted to get feedback from others as to whether you have witnessed this work as expected. We have an issue with our own internal framework that could require a significant amount of work to fix and we don't want to spend the time fixing it unless we know the JDBC driver works as advertised. It would be irrelevant whether we fix it or not if the JDBC driver does not function in the above described fashion.

Anyone have any experience with this? Does it work for you as advertised?

Thanks.

Bill Bailey

Options: ReplyQuote


Subject
Written By
Posted
Connector/J Load Balancing in Master/Slave Environment
July 30, 2012 09:35AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.