when the DB is down, don't wait and try over and over again, simply return the failure
authorfhanik <fhanik@13f79535-47bb-0310-9956-ffa450edef68>
Tue, 28 Oct 2008 16:41:36 +0000 (16:41 +0000)
committerfhanik <fhanik@13f79535-47bb-0310-9956-ffa450edef68>
Tue, 28 Oct 2008 16:41:36 +0000 (16:41 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@708605 13f79535-47bb-0310-9956-ffa450edef68

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

index 7950369..dc5afb8 100644 (file)
@@ -477,8 +477,10 @@ public class ConnectionPool {
                     }\r
                     return con;\r
                 } else {\r
+                    //validation failed.\r
                     release(con);\r
                     setToNull = true;\r
+                    throw new SQLException("Failed to validate a newly established connection.");\r
                 }\r
             } catch (Exception x) {\r
                 release(con);                \r
@@ -495,7 +497,6 @@ public class ConnectionPool {
                 con = null;\r
             }\r
         }\r
-        return con;\r
     }\r
 \r
     /**\r