Return-Path: Delivered-To: apmail-geronimo-scm-archive@www.apache.org Received: (qmail 21038 invoked from network); 13 Jan 2011 23:28:30 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 13 Jan 2011 23:28:30 -0000 Received: (qmail 5660 invoked by uid 500); 13 Jan 2011 23:28:30 -0000 Delivered-To: apmail-geronimo-scm-archive@geronimo.apache.org Received: (qmail 5609 invoked by uid 500); 13 Jan 2011 23:28:29 -0000 Mailing-List: contact scm-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@geronimo.apache.org List-Id: Delivered-To: mailing list scm@geronimo.apache.org Received: (qmail 5602 invoked by uid 99); 13 Jan 2011 23:28:29 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 13 Jan 2011 23:28:29 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.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, 13 Jan 2011 23:28:28 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 791B723888DD; Thu, 13 Jan 2011 23:28:02 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1058796 - in /geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.2: ./ geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/ Date: Thu, 13 Jan 2011 23:28:02 -0000 To: scm@geronimo.apache.org From: djencks@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110113232802.791B723888DD@eris.apache.org> Author: djencks Date: Thu Jan 13 23:28:01 2011 New Revision: 1058796 URL: http://svn.apache.org/viewvc?rev=1058796&view=rev Log: GERONIMO-5754 timing window for expired connections Modified: geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.2/ (props changed) geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.2/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/ (props changed) geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.2/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/AbstractSinglePoolConnectionInterceptor.java geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.2/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/SinglePoolConnectionInterceptor.java geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.2/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/SinglePoolMatchAllConnectionInterceptor.java Propchange: geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.2/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Thu Jan 13 23:28:01 2011 @@ -1,2 +1,2 @@ /geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1.1:981270 -/geronimo/components/txmanager/trunk:900557,911974,912058,912297,912468,939929,1028958 +/geronimo/components/txmanager/trunk:900557,911974,912058,912297,912468,939929,1028958,1058794 Propchange: geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.2/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/ ------------------------------------------------------------------------------ --- svn:mergeinfo (added) +++ svn:mergeinfo Thu Jan 13 23:28:01 2011 @@ -0,0 +1,3 @@ +/geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound:981270 +/geronimo/components/txmanager/trunk/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound:900557,911974,912058,912297,912468,939929,1028958,1058794 +/geronimo/sandbox/djencks/txmanager/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound:1058785,1058792 Modified: geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.2/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/AbstractSinglePoolConnectionInterceptor.java URL: http://svn.apache.org/viewvc/geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.2/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/AbstractSinglePoolConnectionInterceptor.java?rev=1058796&r1=1058795&r2=1058796&view=diff ============================================================================== --- geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.2/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/AbstractSinglePoolConnectionInterceptor.java (original) +++ geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.2/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/AbstractSinglePoolConnectionInterceptor.java Thu Jan 13 23:28:01 2011 @@ -375,7 +375,7 @@ public abstract class AbstractSinglePool interceptor.getExpiredManagedConnectionInfos(threshold, killList); for (ManagedConnectionInfo managedConnectionInfo : killList) { ConnectionInfo killInfo = new ConnectionInfo(managedConnectionInfo); - interceptor.internalReturn(killInfo, ConnectionReturnAction.DESTROY); + parent.next.returnConnection(killInfo, ConnectionReturnAction.DESTROY); } } catch (Throwable t) { log.error("Error occurred during execution of ExpirationMonitor TimerTask", t); Modified: geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.2/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/SinglePoolConnectionInterceptor.java URL: http://svn.apache.org/viewvc/geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.2/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/SinglePoolConnectionInterceptor.java?rev=1058796&r1=1058795&r2=1058796&view=diff ============================================================================== --- geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.2/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/SinglePoolConnectionInterceptor.java (original) +++ geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.2/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/SinglePoolConnectionInterceptor.java Thu Jan 13 23:28:01 2011 @@ -19,6 +19,7 @@ package org.apache.geronimo.connector.ou import java.util.ArrayList; import java.util.Collections; +import java.util.Iterator; import java.util.List; import javax.resource.ResourceException; @@ -160,9 +161,12 @@ public class SinglePoolConnectionInterce protected void getExpiredManagedConnectionInfos(long threshold, List killList) { synchronized (pool) { - for (ManagedConnectionInfo mci : pool) { + for (Iterator mcis = pool.iterator(); mcis.hasNext(); ) { + ManagedConnectionInfo mci = mcis.next(); if (mci.getLastUsed() < threshold) { + mcis.remove(); killList.add(mci); + connectionCount--; } } } Modified: geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.2/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/SinglePoolMatchAllConnectionInterceptor.java URL: http://svn.apache.org/viewvc/geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.2/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/SinglePoolMatchAllConnectionInterceptor.java?rev=1058796&r1=1058795&r2=1058796&view=diff ============================================================================== --- geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.2/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/SinglePoolMatchAllConnectionInterceptor.java (original) +++ geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.2/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/SinglePoolMatchAllConnectionInterceptor.java Thu Jan 13 23:28:01 2011 @@ -140,9 +140,12 @@ public class SinglePoolMatchAllConnectio protected void getExpiredManagedConnectionInfos(long threshold, List killList) { synchronized (pool) { - for (ManagedConnectionInfo mci : pool.values()) { + for (Iterator> mcis = pool.entrySet().iterator(); mcis.hasNext(); ) { + ManagedConnectionInfo mci = mcis.next().getValue(); if (mci.getLastUsed() < threshold) { + mcis.remove(); killList.add(mci); + connectionCount--; } } }