geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r1058794 - /geronimo/components/txmanager/trunk/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/
Date Thu, 13 Jan 2011 23:25:36 GMT
Author: djencks
Date: Thu Jan 13 23:25:36 2011
New Revision: 1058794

URL: http://svn.apache.org/viewvc?rev=1058794&view=rev
Log:
GERONIMO-5754 timing window for expired connections

Modified:
    geronimo/components/txmanager/trunk/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/
  (props changed)
    geronimo/components/txmanager/trunk/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/AbstractSinglePoolConnectionInterceptor.java
    geronimo/components/txmanager/trunk/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/SinglePoolConnectionInterceptor.java
    geronimo/components/txmanager/trunk/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/SinglePoolMatchAllConnectionInterceptor.java

Propchange: geronimo/components/txmanager/trunk/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/
------------------------------------------------------------------------------
--- svn:mergeinfo (added)
+++ svn:mergeinfo Thu Jan 13 23:25:36 2011
@@ -0,0 +1,4 @@
+/geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound:780438-803185,984259,984262,984273
+/geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound:981270
+/geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.2/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound:1023970
+/geronimo/sandbox/djencks/txmanager/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound:1058785,1058792

Modified: geronimo/components/txmanager/trunk/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/AbstractSinglePoolConnectionInterceptor.java
URL: http://svn.apache.org/viewvc/geronimo/components/txmanager/trunk/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/AbstractSinglePoolConnectionInterceptor.java?rev=1058794&r1=1058793&r2=1058794&view=diff
==============================================================================
--- geronimo/components/txmanager/trunk/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/AbstractSinglePoolConnectionInterceptor.java
(original)
+++ geronimo/components/txmanager/trunk/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/AbstractSinglePoolConnectionInterceptor.java
Thu Jan 13 23:25:36 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/trunk/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/SinglePoolConnectionInterceptor.java
URL: http://svn.apache.org/viewvc/geronimo/components/txmanager/trunk/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/SinglePoolConnectionInterceptor.java?rev=1058794&r1=1058793&r2=1058794&view=diff
==============================================================================
--- geronimo/components/txmanager/trunk/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/SinglePoolConnectionInterceptor.java
(original)
+++ geronimo/components/txmanager/trunk/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/SinglePoolConnectionInterceptor.java
Thu Jan 13 23:25:36 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<ManagedConnectionInfo>
killList) {
         synchronized (pool) {
-            for (ManagedConnectionInfo mci : pool) {
+            for (Iterator<ManagedConnectionInfo> mcis = pool.iterator(); mcis.hasNext();
) {
+                ManagedConnectionInfo mci = mcis.next();
                 if (mci.getLastUsed() < threshold) {
+                    mcis.remove();
                     killList.add(mci);
+                    connectionCount--;
                 }
             }
         }

Modified: geronimo/components/txmanager/trunk/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/SinglePoolMatchAllConnectionInterceptor.java
URL: http://svn.apache.org/viewvc/geronimo/components/txmanager/trunk/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/SinglePoolMatchAllConnectionInterceptor.java?rev=1058794&r1=1058793&r2=1058794&view=diff
==============================================================================
--- geronimo/components/txmanager/trunk/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/SinglePoolMatchAllConnectionInterceptor.java
(original)
+++ geronimo/components/txmanager/trunk/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/SinglePoolMatchAllConnectionInterceptor.java
Thu Jan 13 23:25:36 2011
@@ -140,9 +140,12 @@ public class SinglePoolMatchAllConnectio
 
     protected void getExpiredManagedConnectionInfos(long threshold, List<ManagedConnectionInfo>
killList) {
         synchronized (pool) {
-            for (ManagedConnectionInfo mci : pool.values()) {
+            for (Iterator<Map.Entry<ManagedConnection, ManagedConnectionInfo>>
mcis = pool.entrySet().iterator(); mcis.hasNext(); ) {
+                ManagedConnectionInfo mci = mcis.next().getValue();
                 if (mci.getLastUsed() < threshold) {
+                    mcis.remove();
                     killList.add(mci);
+                    connectionCount--;
                 }
             }
         }



Mime
View raw message