From: fhanik Date: Wed, 2 Mar 2011 21:15:07 +0000 (+0000) Subject: https://issues.apache.org/bugzilla/show_bug.cgi?id=50857 X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=8a8971fadc7d006c486a3235c670ad497b664521;p=tomcat7.0 https://issues.apache.org/bugzilla/show_bug.cgi?id=50857 Timeouts have to be trapped, and properly handled git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1076380 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 1583bf2ba..0faccfee6 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 @@ -140,11 +140,16 @@ public class ConnectionPool { * @throws SQLException */ public Future getConnectionAsync() throws SQLException { - PooledConnection pc = this.borrowConnection(0, null, null); - if (pc!=null) { - - return new ConnectionFuture(pc); - } + try { + PooledConnection pc = borrowConnection(0, null, null); + if (pc!=null) { + return new ConnectionFuture(pc); + } + }catch (SQLException x) { + if (x.getMessage().indexOf("NoWait")<0) { + throw x; + } + } //we can only retrieve a future if the underlying queue supports it. if (idle instanceof FairBlockingQueue) { Future pcf = ((FairBlockingQueue)idle).pollAsync();