manifoldcf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1443521 - /manifoldcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/jdbcpool/ConnectionPool.java
Date Thu, 07 Feb 2013 14:55:20 GMT
Author: kwright
Date: Thu Feb  7 14:55:20 2013
New Revision: 1443521

URL: http://svn.apache.org/viewvc?rev=1443521&view=rev
Log:
Expiration of database handles closes connections; if those throw any unusual exceptions,
database handles could be lost from the pool.  Part of CONNECTORS-638.

Modified:
    manifoldcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/jdbcpool/ConnectionPool.java

Modified: manifoldcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/jdbcpool/ConnectionPool.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/jdbcpool/ConnectionPool.java?rev=1443521&r1=1443520&r2=1443521&view=diff
==============================================================================
--- manifoldcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/jdbcpool/ConnectionPool.java
(original)
+++ manifoldcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/jdbcpool/ConnectionPool.java
Thu Feb  7 14:55:20 2013
@@ -192,14 +192,8 @@ public class ConnectionPool
     {
       if (connectionCleanupTimeouts[i] <= currentTime)
       {
-        try
-        {
-          freeConnections[i].close();
-        }
-        catch (SQLException e)
-        {
-          Logging.db.warn("Error closing pooled connection: "+e.getMessage(),e);
-        }
+        Connection c = freeConnections[i];
+        freeConnections[i] = null;
         freePointer--;
         if (freePointer == i)
         {
@@ -211,6 +205,15 @@ public class ConnectionPool
           connectionCleanupTimeouts[i] = connectionCleanupTimeouts[freePointer];
           freeConnections[freePointer] = null;
         }
+        try
+        {
+         c.close();
+        }
+        catch (SQLException e)
+        {
+          Logging.db.warn("Error closing pooled connection: "+e.getMessage(),e);
+        }
+        freePointer--;
       }
       else
         i++;



Mime
View raw message