tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fha...@apache.org
Subject svn commit: r708587 - /tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java
Date Tue, 28 Oct 2008 14:36:30 GMT
Author: fhanik
Date: Tue Oct 28 07:36:30 2008
New Revision: 708587

URL: http://svn.apache.org/viewvc?rev=708587&view=rev
Log:
throw an exception instead of timeout when we fail to reconnect

Modified:
    tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java

Modified: tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java?rev=708587&r1=708586&r2=708587&view=diff
==============================================================================
--- tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java (original)
+++ tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java Tue
Oct 28 07:36:30 2008
@@ -441,7 +441,7 @@
         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 @@
             } catch (Exception x) {
                 release(con);                
                 setToNull = true;
+                if (x instanceof SQLException) {
+                    throw (SQLException)x;
+                } else {
+                    throw new SQLException(x);
+                }
             }
         } finally {
             con.unlock();



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message