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: r1157874 - /tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java
Date Thu, 25 Aug 2011 18:42:45 GMT
1) I think that because of this change the " while (con != null) {"
loop may run infinitely, because when pool.size() is 0 the con
variable is never set to null. You'll repeatedly release the same
connection.

2) Note that this change is in changelog for 7.0.21, but actually it
is not in TC7, because svn:externals property on tc7.0.x/trunk/modules
has not been updated.
      <add>
        <bug>51583</bug> (<rev>1157874</rev>): Fix jdbc-pool shutdown
delay.
        (fhanik)
      </add>


2011/8/15  <fhanik@apache.org>:
> Author: fhanik
> Date: Mon Aug 15 15:06:35 2011
> New Revision: 1157874
>
> URL: http://svn.apache.org/viewvc?rev=1157874&view=rev
> Log:
> Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=51583
>
> Modified:
>    tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java
>
> Modified: tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java
> URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java?rev=1157874&r1=1157873&r2=1157874&view=diff
> ==============================================================================
> --- tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java
(original)
> +++ tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java
Mon Aug 15 15:06:35 2011
> @@ -364,7 +364,9 @@ public class ConnectionPool {
>                         release(con);
>                     else
>                         abandon(con);
> -                    con = pool.poll(1000, TimeUnit.MILLISECONDS);
> +                    if (pool.size()>0) {
> +                        con = pool.poll(1000, TimeUnit.MILLISECONDS);
> +                    }
>                 } //while
>             } catch (InterruptedException ex) {
>                 Thread.interrupted();
>

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