geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r984259 - in /geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1: geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/ geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/transaction...
Date Tue, 10 Aug 2010 23:13:25 GMT
Author: djencks
Date: Tue Aug 10 23:13:24 2010
New Revision: 984259

URL: http://svn.apache.org/viewvc?rev=984259&view=rev
Log:
Manually merge the logging improvements from 2.1.1 branch rev 981012

Modified:
    geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/AbstractSinglePoolConnectionInterceptor.java
    geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/ConnectionHandleInterceptor.java
    geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/ConnectionInfo.java
    geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/ConnectionInterceptor.java
    geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/ConnectionTrackingInterceptor.java
    geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/GenericConnectionManager.java
    geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/LocalXAResourceInsertionInterceptor.java
    geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/MCFConnectionInterceptor.java
    geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/MultiPoolConnectionInterceptor.java
    geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/SinglePoolConnectionInterceptor.java
    geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/SinglePoolMatchAllConnectionInterceptor.java
    geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/SubjectInterceptor.java
    geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/TCCLInterceptor.java
    geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/ThreadLocalCachingConnectionInterceptor.java
    geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/TransactionCachingInterceptor.java
    geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/TransactionEnlistingInterceptor.java
    geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/XAResourceInsertionInterceptor.java
    geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/transactionlog/LogXAResourceInsertionInterceptor.java
    geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-connector/src/test/java/org/apache/geronimo/connector/outbound/AbstractSinglePoolTest.java
    geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-connector/src/test/java/org/apache/geronimo/connector/outbound/ConnectionInterceptorTestUtils.java
    geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-connector/src/test/java/org/apache/geronimo/connector/outbound/connectiontracking/ConnectionTrackingCoordinatorProxyTest.java
    geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-connector/src/test/java/org/apache/geronimo/connector/outbound/connectiontracking/ConnectionTrackingCoordinatorTest.java
    geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-transaction/src/main/java/org/apache/geronimo/transaction/log/XidImpl2.java
    geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-transaction/src/main/java/org/apache/geronimo/transaction/manager/XidImpl.java

Modified: geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/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.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/AbstractSinglePoolConnectionInterceptor.java?rev=984259&r1=984258&r2=984259&view=diff
==============================================================================
--- geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/AbstractSinglePoolConnectionInterceptor.java (original)
+++ geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/AbstractSinglePoolConnectionInterceptor.java Tue Aug 10 23:13:24 2010
@@ -44,7 +44,7 @@ public abstract class AbstractSinglePool
     protected Semaphore permits;
     protected int blockingTimeoutMilliseconds;
     protected int connectionCount = 0;
-    private long idleTimeoutMilliseconds;
+    protected long idleTimeoutMilliseconds;
     private IdleReleaser idleReleaser;
     protected Timer timer = PoolIdleReleaserTimer.getTimer();
     protected int maxSize = 0;
@@ -68,7 +68,7 @@ public abstract class AbstractSinglePool
     public void getConnection(ConnectionInfo connectionInfo) throws ResourceException {
         if (connectionInfo.getManagedConnectionInfo().getManagedConnection() != null) {
             if (log.isTraceEnabled()) {
-                log.trace("using already assigned connection " + connectionInfo.getConnectionHandle() + " for managed connection " + connectionInfo.getManagedConnectionInfo().getManagedConnection() + " to pool " + this);
+                log.trace("supplying already assigned connection from pool " + this + " " + connectionInfo);
             }
             return;
         }
@@ -103,7 +103,7 @@ public abstract class AbstractSinglePool
     public void returnConnection(ConnectionInfo connectionInfo,
                                  ConnectionReturnAction connectionReturnAction) {
         if (log.isTraceEnabled()) {
-            log.trace("returning connection " + connectionInfo.getConnectionHandle() + " for MCI " + connectionInfo.getManagedConnectionInfo() + " to pool " + this);
+            log.trace("returning connection " + connectionInfo.getConnectionHandle() + " for MCI " + connectionInfo.getManagedConnectionInfo() + " and MC " + connectionInfo.getManagedConnectionInfo().getManagedConnection() + " to pool " + this);
         }
 
         // not strictly synchronized with destroy(), but pooled operations in internalReturn() are...
@@ -120,7 +120,9 @@ public abstract class AbstractSinglePool
         try {
             ManagedConnectionInfo mci = connectionInfo.getManagedConnectionInfo();
             if (connectionReturnAction == ConnectionReturnAction.RETURN_HANDLE && mci.hasConnectionHandles()) {
-                log.warn("Return request at pool with connection handles! " + connectionInfo.getConnectionHandle() + " for MCI " + connectionInfo.getManagedConnectionInfo() + " and MC " + connectionInfo.getManagedConnectionInfo().getManagedConnection() + " to pool " + this, new Exception("Stack trace"));
+                if (log.isTraceEnabled()) {
+                    log.trace("Return request at pool with connection handles! " + connectionInfo.getConnectionHandle() + " for MCI " + connectionInfo.getManagedConnectionInfo() + " and MC " + connectionInfo.getManagedConnectionInfo().getManagedConnection() + " to pool " + this, new Exception("Stack trace"));
+                }
                 return;
             }
 
@@ -177,6 +179,9 @@ public abstract class AbstractSinglePool
             }
         }
         //we must destroy connection.
+        if (log.isTraceEnabled()) {
+            log.trace("Discarding connection in pool " + this + " " + connectionInfo);
+        }
         next.returnConnection(connectionInfo, connectionReturnAction);
         connectionCount--;
         return releasePermit;

Modified: geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/ConnectionHandleInterceptor.java
URL: http://svn.apache.org/viewvc/geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/ConnectionHandleInterceptor.java?rev=984259&r1=984258&r2=984259&view=diff
==============================================================================
--- geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/ConnectionHandleInterceptor.java (original)
+++ geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/ConnectionHandleInterceptor.java Tue Aug 10 23:13:24 2010
@@ -74,4 +74,13 @@ public class ConnectionHandleInterceptor
     public void destroy() {
         next.destroy();
     }
+
+    public void info(StringBuilder s) {
+        s.append(getClass().getName()).append("\n");
+        if (next == null) {
+            s.append("<end>");
+        } else {
+            next.info(s);
+        }
+    }
 }

Modified: geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/ConnectionInfo.java
URL: http://svn.apache.org/viewvc/geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/ConnectionInfo.java?rev=984259&r1=984258&r2=984259&view=diff
==============================================================================
--- geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/ConnectionInfo.java (original)
+++ geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/ConnectionInfo.java Tue Aug 10 23:13:24 2010
@@ -123,6 +123,11 @@ public class ConnectionInfo {
         return trace;
     }
 
-
-
+    @Override
+    public String toString() {
+        StringBuilder b = new StringBuilder();
+        b.append("handle: ").append(connection);
+        b.append(mci);
+        return b.toString();
+    }
 } // ConnectionInfo

Modified: geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/ConnectionInterceptor.java
URL: http://svn.apache.org/viewvc/geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/ConnectionInterceptor.java?rev=984259&r1=984258&r2=984259&view=diff
==============================================================================
--- geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/ConnectionInterceptor.java (original)
+++ geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/ConnectionInterceptor.java Tue Aug 10 23:13:24 2010
@@ -36,4 +36,6 @@ public interface ConnectionInterceptor {
 
     void destroy();
 
+    void info(StringBuilder s);
+
 } // ConnectionInterceptor

Modified: geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/ConnectionTrackingInterceptor.java
URL: http://svn.apache.org/viewvc/geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/ConnectionTrackingInterceptor.java?rev=984259&r1=984258&r2=984259&view=diff
==============================================================================
--- geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/ConnectionTrackingInterceptor.java (original)
+++ geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/ConnectionTrackingInterceptor.java Tue Aug 10 23:13:24 2010
@@ -123,4 +123,14 @@ public class ConnectionTrackingIntercept
             }
         }
     }
+
+    public void info(StringBuilder s) {
+        s.append(getClass().getName()).append("[key=").append(key).append("]\n");
+        if (next == null) {
+            s.append("<end>");
+        } else {
+            next.info(s);
+        }
+    }
+
 }

Modified: geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/GenericConnectionManager.java
URL: http://svn.apache.org/viewvc/geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/GenericConnectionManager.java?rev=984259&r1=984258&r2=984259&view=diff
==============================================================================
--- geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/GenericConnectionManager.java (original)
+++ geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/GenericConnectionManager.java Tue Aug 10 23:13:24 2010
@@ -34,7 +34,7 @@ import org.slf4j.LoggerFactory;
  * @version $Rev$ $Date$
  */
 public class GenericConnectionManager extends AbstractConnectionManager {
-    protected static final Logger log = LoggerFactory.getLogger(AbstractSinglePoolConnectionInterceptor.class);
+    protected static final Logger log = LoggerFactory.getLogger(GenericConnectionManager.class);
 
     //default constructor to support externalizable subclasses
     public GenericConnectionManager() {
@@ -125,6 +125,11 @@ public class GenericConnectionManager ex
             }
             tail.setStack(stack);
             this.stack = stack;
+            if (log.isDebugEnabled()) {
+                StringBuilder s = new StringBuilder("ConnectionManager Interceptor stack;\n");
+                stack.info(s);
+                log.debug(s.toString());
+            }
         }
 
         public ConnectionInterceptor getStack() {

Modified: geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/LocalXAResourceInsertionInterceptor.java
URL: http://svn.apache.org/viewvc/geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/LocalXAResourceInsertionInterceptor.java?rev=984259&r1=984258&r2=984259&view=diff
==============================================================================
--- geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/LocalXAResourceInsertionInterceptor.java (original)
+++ geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/LocalXAResourceInsertionInterceptor.java Tue Aug 10 23:13:24 2010
@@ -53,4 +53,14 @@ public class LocalXAResourceInsertionInt
     public void destroy() {
         next.destroy();        
     }
+
+    public void info(StringBuilder s) {
+        s.append(getClass().getName()).append("[name=").append(name).append("]\n");
+        if (next == null) {
+            s.append("<end>");
+        } else {
+            next.info(s);
+        }
+    }
+
 }

Modified: geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/MCFConnectionInterceptor.java
URL: http://svn.apache.org/viewvc/geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/MCFConnectionInterceptor.java?rev=984259&r1=984258&r2=984259&view=diff
==============================================================================
--- geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/MCFConnectionInterceptor.java (original)
+++ geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/MCFConnectionInterceptor.java Tue Aug 10 23:13:24 2010
@@ -83,4 +83,9 @@ public class MCFConnectionInterceptor im
         this.stack = stack;
     }
 
+    public void info(StringBuilder s) {
+        s.append(getClass().getName()).append("[stack=").append(stack).append("]\n");
+        s.append("<end>");
+    }
+
 }

Modified: geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/MultiPoolConnectionInterceptor.java
URL: http://svn.apache.org/viewvc/geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/MultiPoolConnectionInterceptor.java?rev=984259&r1=984258&r2=984259&view=diff
==============================================================================
--- geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/MultiPoolConnectionInterceptor.java (original)
+++ geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/MultiPoolConnectionInterceptor.java Tue Aug 10 23:13:24 2010
@@ -166,6 +166,12 @@ public class MultiPoolConnectionIntercep
         }
     }
 
+    public void info(StringBuilder s) {
+        s.append(getClass().getName()).append("[useSubject=").append(useSubject).append(",useCRI=").append(useCRI).append(",pool count=").append(pools.size()).append("]\n");
+        next.info(s);
+    }
+
+
     static class SubjectCRIKey {
         private final Subject subject;
         private final ConnectionRequestInfo cri;

Modified: geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/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.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/SinglePoolConnectionInterceptor.java?rev=984259&r1=984258&r2=984259&view=diff
==============================================================================
--- geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/SinglePoolConnectionInterceptor.java (original)
+++ geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/SinglePoolConnectionInterceptor.java Tue Aug 10 23:13:24 2010
@@ -69,7 +69,7 @@ public class SinglePoolConnectionInterce
                 next.getConnection(connectionInfo);
                 connectionCount++;
                 if (log.isTraceEnabled()) {
-                    log.trace("Supplying new connection MCI: " + connectionInfo.getManagedConnectionInfo() + " from pool: " + this);
+                    log.trace("Supplying new connection MCI: " + connectionInfo.getManagedConnectionInfo() + " MC: " + connectionInfo.getManagedConnectionInfo().getManagedConnection() + " from pool: " + this);
                 }
                 return;
             } else {
@@ -81,7 +81,7 @@ public class SinglePoolConnectionInterce
             if (selectOneAssumeMatch) {
                 connectionInfo.setManagedConnectionInfo(newMCI);
                 if (log.isTraceEnabled()) {
-                    log.trace("Supplying pooled connection without checking matching MCI: " + connectionInfo.getManagedConnectionInfo() + " from pool: " + this);
+                    log.trace("Supplying pooled connection without checking matching MCI: " + connectionInfo.getManagedConnectionInfo() + " MC: " + connectionInfo.getManagedConnectionInfo().getManagedConnection() + " from pool: " + this);
                 }
                 return;
             }
@@ -168,4 +168,14 @@ public class SinglePoolConnectionInterce
         }
     }
 
+    public void info(StringBuilder s) {
+        s.append(getClass().getName());
+        s.append("[minSize=").append(minSize);
+        s.append(",maxSize=").append(maxSize);
+        s.append(",idleTimeoutMilliseconds=").append(idleTimeoutMilliseconds);
+        s.append(",blockingTimeoutMilliseconds=").append(blockingTimeoutMilliseconds);
+        s.append(".selectOneAssumeMatch=").append(selectOneAssumeMatch).append("]\n");
+        next.info(s);
+    }
+
 }

Modified: geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/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.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/SinglePoolMatchAllConnectionInterceptor.java?rev=984259&r1=984258&r2=984259&view=diff
==============================================================================
--- geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/SinglePoolMatchAllConnectionInterceptor.java (original)
+++ geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/SinglePoolMatchAllConnectionInterceptor.java Tue Aug 10 23:13:24 2010
@@ -67,7 +67,7 @@ public class SinglePoolMatchAllConnectio
                     connectionInfo.setManagedConnectionInfo(pool.get(matchedMC));
                     pool.remove(matchedMC);
                     if (log.isTraceEnabled()) {
-                        log.trace("Returning pooled connection " + connectionInfo.getManagedConnectionInfo());
+                        log.trace("Supplying existing connection from pool " + this + " " + connectionInfo);
                     }
                     if (connectionCount < minSize) {
                         timer.schedule(new FillTask(connectionInfo), 10);
@@ -78,6 +78,7 @@ public class SinglePoolMatchAllConnectio
             //matching failed or pool is empty
             //if pool is at maximum size, pick a cx to kill
             if (connectionCount == maxSize) {
+                log.trace("Pool is at max size but no connections match, picking one to destroy");
                 Iterator iterator = pool.entrySet().iterator();
                 ManagedConnectionInfo kill = (ManagedConnectionInfo) ((Map.Entry) iterator.next()).getValue();
                 iterator.remove();
@@ -87,7 +88,7 @@ public class SinglePoolMatchAllConnectio
             next.getConnection(connectionInfo);
             connectionCount++;
             if (log.isTraceEnabled()) {
-                log.trace("Returning new connection " + connectionInfo.getManagedConnectionInfo());
+                log.trace("Supplying new connection from pool " + this + " " + connectionInfo);
             }
             if (connectionCount < minSize) {
                 timer.schedule(new FillTask(connectionInfo), 10);
@@ -148,4 +149,13 @@ public class SinglePoolMatchAllConnectio
 
     }
 
+    public void info(StringBuilder s) {
+        s.append(getClass().getName());
+        s.append("[minSize=").append(minSize);
+        s.append(",maxSize=").append(maxSize);
+        s.append(",idleTimeoutMilliseconds=").append(idleTimeoutMilliseconds);
+        s.append(",blockingTimeoutMilliseconds=").append(blockingTimeoutMilliseconds).append("]\n");
+        next.info(s);
+    }
+
 }

Modified: geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/SubjectInterceptor.java
URL: http://svn.apache.org/viewvc/geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/SubjectInterceptor.java?rev=984259&r1=984258&r2=984259&view=diff
==============================================================================
--- geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/SubjectInterceptor.java (original)
+++ geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/SubjectInterceptor.java Tue Aug 10 23:13:24 2010
@@ -99,4 +99,9 @@ public class SubjectInterceptor implemen
         next.destroy();
     }
 
+    public void info(StringBuilder s) {
+        s.append(getClass().getName()).append("[subjectSource=").append(subjectSource).append("]\n");
+        next.info(s);
+    }
+
 }

Modified: geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/TCCLInterceptor.java
URL: http://svn.apache.org/viewvc/geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/TCCLInterceptor.java?rev=984259&r1=984258&r2=984259&view=diff
==============================================================================
--- geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/TCCLInterceptor.java (original)
+++ geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/TCCLInterceptor.java Tue Aug 10 23:13:24 2010
@@ -56,4 +56,10 @@ public class TCCLInterceptor implements 
     public void destroy() {
         this.next.destroy();
     }
+
+    public void info(StringBuilder s) {
+        s.append(getClass().getName()).append("[classLoader=").append(classLoader).append("]\n");
+        next.info(s);
+    }
+    
 }

Modified: geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/ThreadLocalCachingConnectionInterceptor.java
URL: http://svn.apache.org/viewvc/geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/ThreadLocalCachingConnectionInterceptor.java?rev=984259&r1=984258&r2=984259&view=diff
==============================================================================
--- geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/ThreadLocalCachingConnectionInterceptor.java (original)
+++ geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/ThreadLocalCachingConnectionInterceptor.java Tue Aug 10 23:13:24 2010
@@ -85,4 +85,10 @@ public class ThreadLocalCachingConnectio
     public void destroy() {
         next.destroy();
     }
+
+    public void info(StringBuilder s) {
+        s.append(getClass().getName()).append("[matchConnections=").append(matchConnections).append("]\n");
+        next.info(s);
+    }
+    
 }

Modified: geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/TransactionCachingInterceptor.java
URL: http://svn.apache.org/viewvc/geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/TransactionCachingInterceptor.java?rev=984259&r1=984258&r2=984259&view=diff
==============================================================================
--- geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/TransactionCachingInterceptor.java (original)
+++ geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/TransactionCachingInterceptor.java Tue Aug 10 23:13:24 2010
@@ -65,7 +65,7 @@ public class TransactionCachingIntercept
         //There can be an inactive transaction context when a connection is requested in
         //Synchronization.afterCompletion().
 
-        // get the current transation and status... if there is a problem just assume there is no transaction present
+        // get the current transaction and status... if there is a problem just assume there is no transaction present
         Transaction transaction = TxUtil.getTransactionIfActive(transactionManager);
         if (transaction != null) {
             ManagedConnectionInfos managedConnectionInfos = ConnectorTransactionContext.get(transaction, this);
@@ -73,6 +73,9 @@ public class TransactionCachingIntercept
                 if (!managedConnectionInfos.containsUnshared(connectionInfo.getManagedConnectionInfo())) {
                     next.getConnection(connectionInfo);
                     managedConnectionInfos.addUnshared(connectionInfo.getManagedConnectionInfo());
+                    if (log.isTraceEnabled()) {
+                        log.trace("Enlisting connection already associated with handle " + infoString(connectionInfo));
+                    }
                 }
             } else {
                 ManagedConnectionInfo managedConnectionInfo = managedConnectionInfos.getShared();
@@ -83,12 +86,15 @@ public class TransactionCachingIntercept
                         //enlists connection
                         next.getConnection(connectionInfo);
                         managedConnectionInfos.addUnshared(previousMci);
+                        if (log.isTraceEnabled()) {
+                            log.trace("Enlisting existing connection associated with connection handle with current tx  " + infoString(connectionInfo));
+                        }
                     } else {
                         connectionInfo.setManagedConnectionInfo(managedConnectionInfo);
 
                         //return;
                         if (log.isTraceEnabled()) {
-                            log.trace("supplying connection from tx cache " + connectionInfo.getConnectionHandle() + " for managed connection " + connectionInfo.getManagedConnectionInfo().getManagedConnection() + " to tx caching interceptor " + this);
+                            log.trace("supplying connection from tx cache  " + infoString(connectionInfo));
                         }
                     }
                 } else {
@@ -108,7 +114,7 @@ public class TransactionCachingIntercept
 
         if (connectionReturnAction == ConnectionReturnAction.DESTROY) {
             if (log.isTraceEnabled()) {
-                log.trace("destroying connection" + connectionInfo.getConnectionHandle() + " for managed connection " + connectionInfo.getManagedConnectionInfo().getManagedConnection() + " to tx caching interceptor " + this);
+                log.trace("destroying connection " + infoString(connectionInfo));
             }
             next.returnConnection(connectionInfo, connectionReturnAction);
             return;
@@ -119,7 +125,7 @@ public class TransactionCachingIntercept
             if (transaction != null) {
                 if (TxUtil.isActive(transaction)) {
                     if (log.isTraceEnabled()) {
-                        log.trace("tx active, not returning connection" + connectionInfo.getConnectionHandle() + " for managed connection " + connectionInfo.getManagedConnectionInfo().getManagedConnection() + " to tx caching interceptor " + this);
+                        log.trace("tx active, not returning connection  " + infoString(connectionInfo));
                     }
                     return;
                 }
@@ -128,14 +134,14 @@ public class TransactionCachingIntercept
                 ManagedConnectionInfos managedConnectionInfos = ConnectorTransactionContext.get(transaction, this);
                 managedConnectionInfos.remove(connectionInfo.getManagedConnectionInfo());
                 if (log.isTraceEnabled()) {
-                    log.trace("tx ended, but not removed");
+                    log.trace("tx ended, return during synchronization afterCompletion " + infoString(connectionInfo));
                 }
             }
         } catch (SystemException e) {
             //ignore
         }
         if (log.isTraceEnabled()) {
-            log.trace("tx ended, returning connection" + connectionInfo.getConnectionHandle() + " for managed connection " + connectionInfo.getManagedConnectionInfo().getManagedConnection() + " to tx caching interceptor " + this);
+            log.trace("tx ended, returning connection " + infoString(connectionInfo));
         }
         internalReturn(connectionInfo, connectionReturnAction);
     }
@@ -143,14 +149,14 @@ public class TransactionCachingIntercept
     private void internalReturn(ConnectionInfo connectionInfo, ConnectionReturnAction connectionReturnAction) {
         if (connectionInfo.getManagedConnectionInfo().hasConnectionHandles()) {
             if (log.isTraceEnabled()) {
-                log.trace("not returning connection from tx cache (has handles) " + connectionInfo.getConnectionHandle() + " for managed connection " + connectionInfo.getManagedConnectionInfo().getManagedConnection() + " to tx caching interceptor " + this);
+                log.trace("not returning connection from tx cache (has handles) " + infoString(connectionInfo));
             }
             return;
         }
         //No transaction, no handles, we return it.
         next.returnConnection(connectionInfo, connectionReturnAction);
         if (log.isTraceEnabled()) {
-            log.trace("completed return of connection through tx cache " + connectionInfo.getConnectionHandle() + " for MCI: " + connectionInfo.getManagedConnectionInfo() + " and MC " + connectionInfo.getManagedConnectionInfo().getManagedConnection() + " to tx caching interceptor " + this);
+            log.trace("completed return of connection through tx cache " + infoString(connectionInfo));
         }
     }
 
@@ -163,13 +169,13 @@ public class TransactionCachingIntercept
         ManagedConnectionInfo sharedMCI = managedConnectionInfos.getShared();
         if (sharedMCI != null) {
             if (log.isTraceEnabled()) {
-                log.trace("Transaction completed, attempting to return shared connection MCI: " + sharedMCI + " for managed connection " + sharedMCI.getManagedConnection() + " to tx caching interceptor " + this);
+                log.trace("Transaction completed, attempting to return shared connection MCI: " + infoString(sharedMCI));
             }
             returnHandle(sharedMCI);
         }
         for (ManagedConnectionInfo managedConnectionInfo : managedConnectionInfos.getUnshared()) {
             if (log.isTraceEnabled()) {
-                log.trace("Transaction completed, attempting to return unshared connection MCI: " + managedConnectionInfo + " for managed connection " + managedConnectionInfo.getManagedConnection() + " to tx caching interceptor " + this);
+                log.trace("Transaction completed, attempting to return unshared connection MCI: " + infoString(managedConnectionInfo));
             }
             returnHandle(managedConnectionInfo);
         }
@@ -181,6 +187,15 @@ public class TransactionCachingIntercept
         internalReturn(connectionInfo, ConnectionReturnAction.RETURN_HANDLE);
     }
 
+    private String infoString(Object connectionInfo) {
+        return "for tx caching interceptor " + this + " " + connectionInfo;
+    }
+
+    public void info(StringBuilder s) {
+        s.append(getClass().getName()).append("[transactionManager=").append(transactionManager).append("]\n");
+        next.info(s);
+    }
+    
     public static class ManagedConnectionInfos {
         private ManagedConnectionInfo shared;
         private Set<ManagedConnectionInfo> unshared = new HashSet<ManagedConnectionInfo>(1);

Modified: geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/TransactionEnlistingInterceptor.java
URL: http://svn.apache.org/viewvc/geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/TransactionEnlistingInterceptor.java?rev=984259&r1=984258&r2=984259&view=diff
==============================================================================
--- geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/TransactionEnlistingInterceptor.java (original)
+++ geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/TransactionEnlistingInterceptor.java Tue Aug 10 23:13:24 2010
@@ -23,6 +23,8 @@ import javax.transaction.SystemException
 import javax.transaction.Transaction;
 import javax.transaction.TransactionManager;
 import javax.transaction.xa.XAResource;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * TransactionEnlistingInterceptor.java
@@ -33,6 +35,7 @@ import javax.transaction.xa.XAResource;
  * @version 1.0
  */
 public class TransactionEnlistingInterceptor implements ConnectionInterceptor {
+    protected static Logger log = LoggerFactory.getLogger(TransactionEnlistingInterceptor.class);
 
     private final ConnectionInterceptor next;
     private final TransactionManager transactionManager;
@@ -51,7 +54,14 @@ public class TransactionEnlistingInterce
             Transaction transaction = TxUtil.getTransactionIfActive(transactionManager);
             if (transaction != null) {
                 XAResource xares = mci.getXAResource();
+                if (log.isTraceEnabled()) {
+                    log.trace("Enlisting connection " + connectionInfo + " with XAResource " + xares + " in transaction: " + transaction);
+                }
                 transaction.enlistResource(xares);
+            } else {
+                if (log.isTraceEnabled()) {
+                    log.trace("not enlisting connection " + connectionInfo + " with XAResource " + mci.getXAResource() + " no transaction");
+                }
             }
         } catch (SystemException e) {
             returnConnection(connectionInfo, ConnectionReturnAction.DESTROY);
@@ -82,11 +92,19 @@ public class TransactionEnlistingInterce
             Transaction transaction = TxUtil.getTransactionIfActive(transactionManager);
             if (transaction != null) {
                 XAResource xares = mci.getXAResource();
+                if (log.isTraceEnabled()) {
+                    log.trace("Delisting connection " + connectionInfo + " with XAResource " + xares + " in transaction: " + transaction, new Exception("stack trace"));
+                }
                 transaction.delistResource(xares, XAResource.TMSUSPEND);
+            } else {
+                if (log.isTraceEnabled()) {
+                    log.trace("not delisting connection " + connectionInfo + " with XAResource " + mci.getXAResource() + " no transaction");
+                }
             }
 
         } catch (SystemException e) {
             //maybe we should warn???
+            log.info("Could not delist resource: " + connectionInfo  + " with XAResource: " + connectionInfo.getManagedConnectionInfo().getXAResource(), e);
             connectionReturnAction = ConnectionReturnAction.DESTROY;
         } catch (IllegalStateException e) {
             connectionReturnAction = ConnectionReturnAction.DESTROY;
@@ -99,4 +117,9 @@ public class TransactionEnlistingInterce
         next.destroy();
     }
 
+    public void info(StringBuilder s) {
+        s.append(getClass().getName()).append("[transactionManager=").append(transactionManager).append("]\n");
+        next.info(s);
+    }
+
 }

Modified: geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/XAResourceInsertionInterceptor.java
URL: http://svn.apache.org/viewvc/geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/XAResourceInsertionInterceptor.java?rev=984259&r1=984258&r2=984259&view=diff
==============================================================================
--- geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/XAResourceInsertionInterceptor.java (original)
+++ geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/XAResourceInsertionInterceptor.java Tue Aug 10 23:13:24 2010
@@ -51,4 +51,9 @@ public class XAResourceInsertionIntercep
         next.destroy();
     }
 
+    public void info(StringBuilder s) {
+        s.append(getClass().getName()).append("[name=").append(name).append("]\n");
+        next.info(s);
+    }
+
 }

Modified: geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/transactionlog/LogXAResourceInsertionInterceptor.java
URL: http://svn.apache.org/viewvc/geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/transactionlog/LogXAResourceInsertionInterceptor.java?rev=984259&r1=984258&r2=984259&view=diff
==============================================================================
--- geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/transactionlog/LogXAResourceInsertionInterceptor.java (original)
+++ geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/transactionlog/LogXAResourceInsertionInterceptor.java Tue Aug 10 23:13:24 2010
@@ -59,4 +59,14 @@ public class LogXAResourceInsertionInter
     public void destroy() {
         next.destroy();
     }
+
+    public void info(StringBuilder s) {
+        s.append(getClass().getName()).append("[name=").append(name).append("]\n");
+        if (next == null) {
+            s.append("<end>");
+        } else {
+            next.info(s);
+        }
+    }
+
 }

Modified: geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-connector/src/test/java/org/apache/geronimo/connector/outbound/AbstractSinglePoolTest.java
URL: http://svn.apache.org/viewvc/geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-connector/src/test/java/org/apache/geronimo/connector/outbound/AbstractSinglePoolTest.java?rev=984259&r1=984258&r2=984259&view=diff
==============================================================================
--- geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-connector/src/test/java/org/apache/geronimo/connector/outbound/AbstractSinglePoolTest.java (original)
+++ geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-connector/src/test/java/org/apache/geronimo/connector/outbound/AbstractSinglePoolTest.java Tue Aug 10 23:13:24 2010
@@ -268,5 +268,11 @@ public class AbstractSinglePoolTest exte
         public void destroy() {
             next.destroy();
         }
+
+        public void info(StringBuilder s) {
+            s.append(getClass().getName()).append("\n");
+            next.info(s);
+        }
+
     }
 }

Modified: geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-connector/src/test/java/org/apache/geronimo/connector/outbound/ConnectionInterceptorTestUtils.java
URL: http://svn.apache.org/viewvc/geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-connector/src/test/java/org/apache/geronimo/connector/outbound/ConnectionInterceptorTestUtils.java?rev=984259&r1=984258&r2=984259&view=diff
==============================================================================
--- geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-connector/src/test/java/org/apache/geronimo/connector/outbound/ConnectionInterceptorTestUtils.java (original)
+++ geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-connector/src/test/java/org/apache/geronimo/connector/outbound/ConnectionInterceptorTestUtils.java Tue Aug 10 23:13:24 2010
@@ -183,4 +183,9 @@ public class ConnectionInterceptorTestUt
         }
 
     }
+    public void info(StringBuilder s) {
+        s.append(getClass().getName()).append("\n");
+        s.append("<end>");
+    }
+
 }

Modified: geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-connector/src/test/java/org/apache/geronimo/connector/outbound/connectiontracking/ConnectionTrackingCoordinatorProxyTest.java
URL: http://svn.apache.org/viewvc/geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-connector/src/test/java/org/apache/geronimo/connector/outbound/connectiontracking/ConnectionTrackingCoordinatorProxyTest.java?rev=984259&r1=984258&r2=984259&view=diff
==============================================================================
--- geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-connector/src/test/java/org/apache/geronimo/connector/outbound/connectiontracking/ConnectionTrackingCoordinatorProxyTest.java (original)
+++ geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-connector/src/test/java/org/apache/geronimo/connector/outbound/connectiontracking/ConnectionTrackingCoordinatorProxyTest.java Tue Aug 10 23:13:24 2010
@@ -276,6 +276,10 @@ public class ConnectionTrackingCoordinat
     public void destroy() {
     }
 
+    public void info(StringBuilder s) {
+        s.append(getClass().getName()).append("\n");
+    }
+
     private ConnectionInfo createConnectionInfo() {
         ConnectionInfo ci = new ConnectionInfo(mci);
         ci.setConnectionHandle(connection);

Modified: geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-connector/src/test/java/org/apache/geronimo/connector/outbound/connectiontracking/ConnectionTrackingCoordinatorTest.java
URL: http://svn.apache.org/viewvc/geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-connector/src/test/java/org/apache/geronimo/connector/outbound/connectiontracking/ConnectionTrackingCoordinatorTest.java?rev=984259&r1=984258&r2=984259&view=diff
==============================================================================
--- geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-connector/src/test/java/org/apache/geronimo/connector/outbound/connectiontracking/ConnectionTrackingCoordinatorTest.java (original)
+++ geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-connector/src/test/java/org/apache/geronimo/connector/outbound/connectiontracking/ConnectionTrackingCoordinatorTest.java Tue Aug 10 23:13:24 2010
@@ -166,4 +166,10 @@ public class ConnectionTrackingCoordinat
 
     public void destroy() {        
     }
+
+    public void info(StringBuilder s) {
+        s.append(getClass().getName()).append("\n");
+        s.append("<end>");
+    }
+
 }

Modified: geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-transaction/src/main/java/org/apache/geronimo/transaction/log/XidImpl2.java
URL: http://svn.apache.org/viewvc/geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-transaction/src/main/java/org/apache/geronimo/transaction/log/XidImpl2.java?rev=984259&r1=984258&r2=984259&view=diff
==============================================================================
--- geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-transaction/src/main/java/org/apache/geronimo/transaction/log/XidImpl2.java (original)
+++ geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-transaction/src/main/java/org/apache/geronimo/transaction/log/XidImpl2.java Tue Aug 10 23:13:24 2010
@@ -53,6 +53,16 @@ public class XidImpl2 implements Xid, Se
         System.arraycopy(globalId, 0, buffer, HEADER_SIZE + FORMAT_SIZE, Xid.MAXGTRIDSIZE);
 
         //this.hash = hash(buffer);
+        check();
+    }
+
+    private void check() {
+        if (buffer[GLOBALID_SIZE_POS] > Xid.MAXGTRIDSIZE) {
+            throw new IllegalStateException("Global ID too large: " + buffer[GLOBALID_SIZE_POS]);
+        }
+        if (buffer[BRANCHID_SIZE_POS] > Xid.MAXBQUALSIZE) {
+            throw new IllegalStateException("Branch ID too large: " + buffer[GLOBALID_SIZE_POS]);
+        }
     }
 
     /**
@@ -71,6 +81,7 @@ public class XidImpl2 implements Xid, Se
         buffer[BRANCHID_SIZE_POS] = (byte) branch.length;
         System.arraycopy(branch, 0, buffer, HEADER_SIZE + FORMAT_SIZE + Xid.MAXGTRIDSIZE, Xid.MAXBQUALSIZE);
         //hash = hash(buffer);
+        check();
     }
 
     public XidImpl2(int formatId, byte[] globalId, byte[] branch) {
@@ -80,6 +91,7 @@ public class XidImpl2 implements Xid, Se
         buffer[BRANCHID_SIZE_POS] = (byte) branch.length;
         System.arraycopy(branch, 0, buffer, HEADER_SIZE + FORMAT_SIZE + Xid.MAXGTRIDSIZE, Xid.MAXBQUALSIZE);
         //hash = hash(buffer);
+        check();
     }
 
     private int hash(byte[] id) {
@@ -122,7 +134,7 @@ public class XidImpl2 implements Xid, Se
     }
 
     public String toString() {
-        StringBuffer s = new StringBuffer("[formatId=Gero,");
+        StringBuffer s = new StringBuffer("[XidImpl2:formatId=Gero,");
         s.append("globalId=");
         for (int i = FORMAT_SIZE; i < FORMAT_SIZE + Xid.MAXGTRIDSIZE; i++) {
             s.append(Integer.toHexString(buffer[i]));

Modified: geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-transaction/src/main/java/org/apache/geronimo/transaction/manager/XidImpl.java
URL: http://svn.apache.org/viewvc/geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-transaction/src/main/java/org/apache/geronimo/transaction/manager/XidImpl.java?rev=984259&r1=984258&r2=984259&view=diff
==============================================================================
--- geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-transaction/src/main/java/org/apache/geronimo/transaction/manager/XidImpl.java (original)
+++ geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1/geronimo-transaction/src/main/java/org/apache/geronimo/transaction/manager/XidImpl.java Tue Aug 10 23:13:24 2010
@@ -42,6 +42,16 @@ public class XidImpl implements Xid, Ser
         this.globalId = globalId;
         //this.hash = hash(0, globalId);
         branchId = new byte[Xid.MAXBQUALSIZE];
+        check();
+    }
+
+    private void check() {
+        if (globalId.length > Xid.MAXGTRIDSIZE) {
+            throw new IllegalStateException("Global id is too long: " + toString());
+        }
+        if (branchId.length > Xid.MAXBQUALSIZE) {
+            throw new IllegalStateException("Branch id is too long: " + toString());
+        }
     }
 
     /**
@@ -61,12 +71,14 @@ public class XidImpl implements Xid, Ser
         }
         branchId = branch;
         //this.hash = hash(hash, branchId);
+        check();
     }
 
     public XidImpl(int formatId, byte[] globalId, byte[] branchId) {
         this.formatId = formatId;
         this.globalId = globalId;
         this.branchId = branchId;
+        check();
     }
 
     private int hash(int hash, byte[] id) {
@@ -106,15 +118,18 @@ public class XidImpl implements Xid, Ser
     }
 
     public String toString() {
-        StringBuffer s = new StringBuffer();
-        s.append("[globalId=");
+        StringBuilder s = new StringBuilder();
+        s.append("[Xid:globalId=");
         for (int i = 0; i < globalId.length; i++) {
             s.append(Integer.toHexString(globalId[i]));
         }
+        s.append(",length=").append(globalId.length);
         s.append(",branchId=");
         for (int i = 0; i < branchId.length; i++) {
             s.append(Integer.toHexString(branchId[i]));
         }
+        s.append(",length=");
+        s.append(branchId.length);
         s.append("]");
         return s.toString();
     }



Mime
View raw message