Return-Path: X-Original-To: apmail-manifoldcf-commits-archive@www.apache.org Delivered-To: apmail-manifoldcf-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B0334EF57 for ; Thu, 7 Feb 2013 14:55:43 +0000 (UTC) Received: (qmail 1490 invoked by uid 500); 7 Feb 2013 14:55:43 -0000 Delivered-To: apmail-manifoldcf-commits-archive@manifoldcf.apache.org Received: (qmail 870 invoked by uid 500); 7 Feb 2013 14:55:41 -0000 Mailing-List: contact commits-help@manifoldcf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@manifoldcf.apache.org Delivered-To: mailing list commits@manifoldcf.apache.org Received: (qmail 833 invoked by uid 99); 7 Feb 2013 14:55:40 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Feb 2013 14:55:40 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Feb 2013 14:55:39 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id AF12823889CB; Thu, 7 Feb 2013 14:55:20 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: commits@manifoldcf.apache.org From: kwright@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20130207145520.AF12823889CB@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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++;