throw an exception instead of timeout when we fail to reconnect
authorfhanik <fhanik@13f79535-47bb-0310-9956-ffa450edef68>
Tue, 28 Oct 2008 14:36:30 +0000 (14:36 +0000)
committerfhanik <fhanik@13f79535-47bb-0310-9956-ffa450edef68>
Tue, 28 Oct 2008 14:36:30 +0000 (14:36 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@708587 13f79535-47bb-0310-9956-ffa450edef68

modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java

index f953ec7..24cab97 100644 (file)
@@ -441,7 +441,7 @@ public class ConnectionPool {
         return null;\r
     }\r
 \r
-    protected PooledConnection borrowConnection(long now, PooledConnection con) {\r
+    protected PooledConnection borrowConnection(long now, PooledConnection con) throws SQLException {\r
         //we have a connection, lets set it up\r
         boolean setToNull = false;\r
         try {\r
@@ -483,6 +483,11 @@ public class ConnectionPool {
             } catch (Exception x) {\r
                 release(con);                \r
                 setToNull = true;\r
+                if (x instanceof SQLException) {\r
+                    throw (SQLException)x;\r
+                } else {\r
+                    throw new SQLException(x);\r
+                }\r
             }\r
         } finally {\r
             con.unlock();\r