You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by dj...@apache.org on 2011/01/14 00:28:02 UTC
svn commit: r1058796 - in
/geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.2: ./
geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/
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<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/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<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--;
}
}
}