2011/9/26 Konstantin Kolinko <knst.koli...@gmail.com>: > 2011/9/14 <kfuj...@apache.org>: >> Author: kfujino >> Date: Wed Sep 14 09:05:40 2011 >> New Revision: 1170485 >> >> URL: http://svn.apache.org/viewvc?rev=1170485&view=rev >> Log: >> Additional fix for r1170479. >> Make sure calling disconnect() when only setDiscarded(true) is called and >> the real connection is not closed. >> >> Modified: >> >> tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PooledConnection.java >> >> Modified: >> tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PooledConnection.java >> URL: >> http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PooledConnection.java?rev=1170485&r1=1170484&r2=1170485&view=diff >> ============================================================================== >> --- >> tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PooledConnection.java >> (original) >> +++ >> tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PooledConnection.java >> Wed Sep 14 09:05:40 2011 >> @@ -309,7 +309,7 @@ public class PooledConnection { >> * @param finalize if set to true, a call to {@link >> ConnectionPool#finalize(PooledConnection)} is called. >> */ >> private void disconnect(boolean finalize) { >> - if (isDiscarded()) { >> + if (isDiscarded() && connection == null) { >> return; >> } > > I think that the above code had to be > if (isDiscarded() || connection == null) { > return; > } >
I understand the code now. Your change was OK. I did not notice that there is "if (connection != null) {}" block below, that handles the case of null connection. Best regards, Konstantin Kolinko --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org