From 11a3be25db8864a580837d3bc8857707209d574d Mon Sep 17 00:00:00 2001 From: markt Date: Wed, 15 Sep 2010 13:24:14 +0000 Subject: [PATCH] Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=49584 Move the offering of a new thread on release from the abandoned connection code to the release code to eliminate the possibility of a blocked thread on release. git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@997321 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/apache/tomcat/jdbc/pool/ConnectionPool.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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 81a87796d..8b00d70f9 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 @@ -466,9 +466,6 @@ public class ConnectionPool { } //release the connection release(con); - //we've asynchronously reduced the number of connections - //we could have threads stuck in idle.poll(timeout) that will never be notified - if (waitcount.get()>0) idle.offer(new PooledConnection(poolProperties,this)); } finally { con.unlock(); } @@ -517,6 +514,12 @@ public class ConnectionPool { } finally { con.unlock(); } + // we've asynchronously reduced the number of connections + // we could have threads stuck in idle.poll(timeout) that will never be + // notified + if (waitcount.get() > 0) { + idle.offer(new PooledConnection(poolProperties, this)); + } } /** -- 2.11.0