Bug #35660 When using keyword “loadbalance” in the connection string, Java driver hangs
Submitted: 28 Mar 2008 22:18 Modified: 7 Jul 2008 12:21
Reporter: Dany Jurkovic Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / J Severity:S2 (Serious)
Version:mysql-connector-java-5.1.6-bin.jar OS:Microsoft Windows (2003)
Assigned to:
Tags: loadbalance

[28 Mar 2008 22:18] Dany Jurkovic
Description:
When using the keyword “loadbalance” in the connection string and try to perform load balancing between 2 databases, we are experimenting problem with the driver (we are using driver mysql-connector-java-5.1.6-bin.jar). The driver seems to hang.

 

We investigated the problem and this is what we have found:

It seems that when “loadbalance” keyword is in the connection string, mysql implementation of the equals method inside the Connection class returns false for comparing a connection object whereas it returns true when the “loadbalance” keyword is omitted from the connection string. This causes the connection objects not to get put back in the pool for re-use which explains our load test problems: “running out of connections and timeouts”.

How to repeat:
n/a
[31 Mar 2008 15:27] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/44688
[7 Jul 2008 12:21] Tony Bedford
An entry has been added to the 5.1.6 Changelog:

When using the keyword “loadbalance” in the connection string and trying to perform load balancing between two databases, the driver appears to hang.
[30 Jul 2008 14:53] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/50724