djencks 2004/04/22 10:03:28
Modified: modules/connector/src/java/org/apache/geronimo/connector/outbound
ConnectionHandleInterceptor.java
ConnectionInfo.java
ConnectionManagerDeployment.java
ConnectionTrackingInterceptor.java
Log:
add some connection leak tracing help
Revision Changes Path
1.4 +2 -1
incubator-geronimo/modules/connector/src/java/org/apache/geronimo/connector/outbound/ConnectionHandleInterceptor.java
Index: ConnectionHandleInterceptor.java
===================================================================
RCS file:
/home/cvs/incubator-geronimo/modules/connector/src/java/org/apache/geronimo/connector/outbound/ConnectionHandleInterceptor.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ConnectionHandleInterceptor.java 10 Mar 2004 09:58:31 -0000 1.3
+++ ConnectionHandleInterceptor.java 22 Apr 2004 17:03:28 -0000 1.4
@@ -53,6 +53,7 @@
connectionInfo.getConnectionHandle());
}
mci.addConnectionHandle(connectionInfo);
+ connectionInfo.setTrace();
}
/**
1.5 +9 -0
incubator-geronimo/modules/connector/src/java/org/apache/geronimo/connector/outbound/ConnectionInfo.java
Index: ConnectionInfo.java
===================================================================
RCS file:
/home/cvs/incubator-geronimo/modules/connector/src/java/org/apache/geronimo/connector/outbound/ConnectionInfo.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- ConnectionInfo.java 7 Apr 2004 22:37:10 -0000 1.4
+++ ConnectionInfo.java 22 Apr 2004 17:03:28 -0000 1.5
@@ -29,6 +29,7 @@
private ManagedConnectionInfo mci;
private Object connection;
+ private Exception trace;
public ConnectionInfo() {
} // ConnectionInfo constructor
@@ -85,6 +86,14 @@
public int hashCode() {
return ((connection != null) ? connection.hashCode() : 7) ^
((mci != null) ? mci.hashCode() : 7);
+ }
+
+ public void setTrace() {
+ this.trace = new Exception("Stack Trace");
+ }
+
+ public Exception getTrace() {
+ return trace;
}
} // ConnectionInfo
1.11 +18 -16
incubator-geronimo/modules/connector/src/java/org/apache/geronimo/connector/outbound/ConnectionManagerDeployment.java
Index: ConnectionManagerDeployment.java
===================================================================
RCS file:
/home/cvs/incubator-geronimo/modules/connector/src/java/org/apache/geronimo/connector/outbound/ConnectionManagerDeployment.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- ConnectionManagerDeployment.java 19 Apr 2004 22:29:54 -0000 1.10
+++ ConnectionManagerDeployment.java 22 Apr 2004 17:03:28 -0000 1.11
@@ -123,21 +123,23 @@
stack = new XAResourceInsertionInterceptor(stack);
}
}
-// if (useSubject || useConnectionRequestInfo) {
-// stack = new MultiPoolConnectionInterceptor(
-// stack,
-// maxSize,
-// blockingTimeout,
-// useSubject,
-// useConnectionRequestInfo);
-// } else {
-// stack = new SinglePoolConnectionInterceptor(
-// stack,
-// null,
-// null,
-// maxSize,
-// blockingTimeout);
-// }
+ if (useSubject || useConnectionRequestInfo) {
+ stack = new MultiPoolConnectionInterceptor(
+ stack,
+ maxSize,
+ blockingTimeout,
+ useSubject,
+ useConnectionRequestInfo);
+ } else {
+ stack = new SinglePoolConnectionInterceptor(
+ stack,
+ null,
+ null,
+ maxSize,
+ blockingTimeout);
+ }
+ //experimental threadlocal caching
+ //stack = new ThreadLocalCachingConnectionInterceptor(stack, false);
if (realmBridge != null) {
stack = new SubjectInterceptor(stack, realmBridge);
}
1.8 +3 -2
incubator-geronimo/modules/connector/src/java/org/apache/geronimo/connector/outbound/ConnectionTrackingInterceptor.java
Index: ConnectionTrackingInterceptor.java
===================================================================
RCS file:
/home/cvs/incubator-geronimo/modules/connector/src/java/org/apache/geronimo/connector/outbound/ConnectionTrackingInterceptor.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- ConnectionTrackingInterceptor.java 7 Apr 2004 22:37:10 -0000
1.7
+++ ConnectionTrackingInterceptor.java 22 Apr 2004 17:03:28 -0000
1.8
@@ -137,8 +137,9 @@
assert size - 1 == connectionInfos.size();
((DissociatableManagedConnection)
managedConnection).dissociateConnections();
managedConnectionInfo.clearConnectionHandles();
+ //todo this needs some kind of check so cx isn't returned
more than once
+ //in case dissociate calls connection closed event and
returns cx to pool.
returnConnection(connectionInfo,
ConnectionReturnAction.RETURN_HANDLE);
- assert size - 1 == connectionInfos.size();
}
}
}