=== modified file 'CHANGES' --- CHANGES 2009-12-18 22:39:31 +0000 +++ CHANGES 2010-01-12 20:34:03 +0000 @@ -3,6 +3,9 @@ mm-dd-yy - Version 5.1.11 (not yet released) + - Fix for BUG#50288 - NullPointerException possible during invalidateCurrentConnection() for load-balanced + connections. + - Fix for BUG#49745 - deleteRow() for updatable result sets can cause full table scan because escaped hex values are used for primary key identifiers. === modified file 'src/com/mysql/jdbc/LoadBalancingConnectionProxy.java' --- src/com/mysql/jdbc/LoadBalancingConnectionProxy.java 2009-11-19 15:30:38 +0000 +++ src/com/mysql/jdbc/LoadBalancingConnectionProxy.java 2010-01-12 20:32:00 +0000 @@ -285,19 +285,15 @@ // remove from liveConnections this.liveConnections.remove(this.connectionsToHostsMap .get(this.currentConn)); - if(this.connectionsToHostsMap.containsKey(this.currentConn)){ - int hostIndex = ((Integer) this.hostsToListIndexMap - .get(this.connectionsToHostsMap.get(this.currentConn))) - .intValue(); - + Object mappedHost = this.connectionsToHostsMap.remove(this.currentConn); + if(mappedHost != null && this.hostsToListIndexMap.containsKey(mappedHost)){ + int hostIndex = ((Integer) this.hostsToListIndexMap.get(mappedHost)).intValue(); // reset the statistics for the host synchronized (this.responseTimes) { this.responseTimes[hostIndex] = 0; } } - - this.connectionsToHostsMap.remove(this.currentConn); - } + } } private void closeAllConnections(){