From: fhanik Date: Fri, 10 Jul 2009 16:42:00 +0000 (+0000) Subject: correct counter behavior. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=6ac4c3def6e85a309f4c6b58d90709520cd6ffc8;p=tomcat7.0 correct counter behavior. git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@793029 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java b/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java index a8ea1c5a1..c2c69f5f1 100644 --- a/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java +++ b/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java @@ -532,10 +532,11 @@ public class ConnectionPool { 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