tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fha...@apache.org
Subject svn commit: r793029 - /tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java
Date Fri, 10 Jul 2009 16:42:00 GMT
Author: fhanik
Date: Fri Jul 10 16:42:00 2009
New Revision: 793029

URL: http://svn.apache.org/viewvc?rev=793029&view=rev
Log:
correct counter behavior.

Modified:
    tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java

Modified: tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java?rev=793029&r1=793028&r2=793029&view=diff
==============================================================================
--- tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java (original)
+++ tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java Fri
Jul 10 16:42:00 2009
@@ -532,10 +532,11 @@
             if (size.get() < getPoolProperties().getMaxActive()) {
                 //atomic duplicate check
                 if (size.addAndGet(1) > getPoolProperties().getMaxActive()) {
-                    return createConnection(now, con);
-                } else {
                     //if we got here, two threads passed through the first if
                     size.decrementAndGet();
+                } else {
+                    //create a connection, we're below the limit
+                    return createConnection(now, con);
                 }
             } //end if
 



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


Mime
View raw message