From: fhanik Date: Tue, 28 Oct 2008 14:36:30 +0000 (+0000) Subject: throw an exception instead of timeout when we fail to reconnect X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=ace7973b49c4b37dc28160b06fdc1e8b83920efa;p=tomcat7.0 throw an exception instead of timeout when we fail to reconnect git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@708587 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 f953ec700..24cab9765 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 @@ -441,7 +441,7 @@ public class ConnectionPool { return null; } - protected PooledConnection borrowConnection(long now, PooledConnection con) { + protected PooledConnection borrowConnection(long now, PooledConnection con) throws SQLException { //we have a connection, lets set it up boolean setToNull = false; try { @@ -483,6 +483,11 @@ public class ConnectionPool { } catch (Exception x) { release(con); setToNull = true; + if (x instanceof SQLException) { + throw (SQLException)x; + } else { + throw new SQLException(x); + } } } finally { con.unlock();