tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Konstantin Kolinko <knst.koli...@gmail.com>
Subject Re: svn commit: r1170485 - /tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PooledConnection.java
Date Mon, 26 Sep 2011 01:07:53 GMT
2011/9/14  <kfujino@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;
    }

>         setDiscarded(true);
>

Best regards,
Konstantin Kolinko

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message