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 2010/07/31 08:59:53 UTC

svn commit: r981012 - in /geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1.1: ./ geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/ geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/transa...

Author: djencks
Date: Sat Jul 31 06:59:52 2010
New Revision: 981012

URL: http://svn.apache.org/viewvc?rev=981012&view=rev
Log:
Branch to add troubleshooting logging to txmanager 2.1.1.  Not really intended for release

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

Modified: geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1.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.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/AbstractSinglePoolConnectionInterceptor.java?rev=981012&r1=962417&r2=981012&view=diff
==============================================================================
--- geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/AbstractSinglePoolConnectionInterceptor.java (original)
+++ geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/AbstractSinglePoolConnectionInterceptor.java Sat Jul 31 06:59:52 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;
         }
@@ -171,6 +171,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.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.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/ConnectionHandleInterceptor.java?rev=981012&r1=962417&r2=981012&view=diff
==============================================================================
--- geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/ConnectionHandleInterceptor.java (original)
+++ geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/ConnectionHandleInterceptor.java Sat Jul 31 06:59:52 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.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.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/ConnectionInfo.java?rev=981012&r1=962417&r2=981012&view=diff
==============================================================================
--- geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/ConnectionInfo.java (original)
+++ geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/ConnectionInfo.java Sat Jul 31 06:59:52 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.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.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/ConnectionInterceptor.java?rev=981012&r1=962417&r2=981012&view=diff
==============================================================================
--- geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/ConnectionInterceptor.java (original)
+++ geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/ConnectionInterceptor.java Sat Jul 31 06:59:52 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.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.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/ConnectionTrackingInterceptor.java?rev=981012&r1=962417&r2=981012&view=diff
==============================================================================
--- geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/ConnectionTrackingInterceptor.java (original)
+++ geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/ConnectionTrackingInterceptor.java Sat Jul 31 06:59:52 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.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.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/GenericConnectionManager.java?rev=981012&r1=962417&r2=981012&view=diff
==============================================================================
--- geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/GenericConnectionManager.java (original)
+++ geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/GenericConnectionManager.java Sat Jul 31 06:59:52 2010
@@ -34,7 +34,7 @@ import org.apache.geronimo.transaction.m
  * @version $Rev$ $Date$
  */
 public class GenericConnectionManager extends AbstractConnectionManager {
-    protected static final Log log = LogFactory.getLog(AbstractSinglePoolConnectionInterceptor.class.getName());
+    protected static final Log log = LogFactory.getLog(GenericConnectionManager.class.getName());
 
     //default constructor for use as endpoint
     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.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.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/LocalXAResourceInsertionInterceptor.java?rev=981012&r1=962417&r2=981012&view=diff
==============================================================================
--- geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/LocalXAResourceInsertionInterceptor.java (original)
+++ geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/LocalXAResourceInsertionInterceptor.java Sat Jul 31 06:59:52 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.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.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/MCFConnectionInterceptor.java?rev=981012&r1=962417&r2=981012&view=diff
==============================================================================
--- geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/MCFConnectionInterceptor.java (original)
+++ geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/MCFConnectionInterceptor.java Sat Jul 31 06:59:52 2010
@@ -82,4 +82,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.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.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/MultiPoolConnectionInterceptor.java?rev=981012&r1=962417&r2=981012&view=diff
==============================================================================
--- geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/MultiPoolConnectionInterceptor.java (original)
+++ geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/MultiPoolConnectionInterceptor.java Sat Jul 31 06:59:52 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.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.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/SinglePoolConnectionInterceptor.java?rev=981012&r1=962417&r2=981012&view=diff
==============================================================================
--- geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/SinglePoolConnectionInterceptor.java (original)
+++ geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/SinglePoolConnectionInterceptor.java Sat Jul 31 06:59:52 2010
@@ -163,4 +163,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.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.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/SinglePoolMatchAllConnectionInterceptor.java?rev=981012&r1=962417&r2=981012&view=diff
==============================================================================
--- geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/SinglePoolMatchAllConnectionInterceptor.java (original)
+++ geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/SinglePoolMatchAllConnectionInterceptor.java Sat Jul 31 06:59:52 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.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.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/SubjectInterceptor.java?rev=981012&r1=962417&r2=981012&view=diff
==============================================================================
--- geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/SubjectInterceptor.java (original)
+++ geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/SubjectInterceptor.java Sat Jul 31 06:59:52 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.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.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/TCCLInterceptor.java?rev=981012&r1=962417&r2=981012&view=diff
==============================================================================
--- geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/TCCLInterceptor.java (original)
+++ geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/TCCLInterceptor.java Sat Jul 31 06:59:52 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.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.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/ThreadLocalCachingConnectionInterceptor.java?rev=981012&r1=962417&r2=981012&view=diff
==============================================================================
--- geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/ThreadLocalCachingConnectionInterceptor.java (original)
+++ geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/ThreadLocalCachingConnectionInterceptor.java Sat Jul 31 06:59:52 2010
@@ -80,4 +80,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.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.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/TransactionCachingInterceptor.java?rev=981012&r1=962417&r2=981012&view=diff
==============================================================================
--- geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/TransactionCachingInterceptor.java (original)
+++ geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/TransactionCachingInterceptor.java Sat Jul 31 06:59:52 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();
@@ -80,13 +83,13 @@ public class TransactionCachingIntercept
                     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 {
                     next.getConnection(connectionInfo);
                     managedConnectionInfos.setShared(connectionInfo.getManagedConnectionInfo());
                     if (log.isTraceEnabled()) {
-                        log.trace("supplying connection from pool " + connectionInfo.getConnectionHandle() + " for managed connection " + connectionInfo.getManagedConnectionInfo().getManagedConnection() + " to tx caching interceptor " + this);
+                        log.trace("supplying connection from pool  " + infoString(connectionInfo));
                     }
                 }
             }
@@ -99,7 +102,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;
@@ -110,7 +113,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;
                 }
@@ -119,14 +122,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);
     }
@@ -134,14 +137,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));
         }
     }
 
@@ -154,13 +157,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);
         }
@@ -172,6 +175,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.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.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/TransactionEnlistingInterceptor.java?rev=981012&r1=962417&r2=981012&view=diff
==============================================================================
--- geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/TransactionEnlistingInterceptor.java (original)
+++ geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/TransactionEnlistingInterceptor.java Sat Jul 31 06:59:52 2010
@@ -23,6 +23,8 @@ import javax.transaction.SystemException
 import javax.transaction.Transaction;
 import javax.transaction.TransactionManager;
 import javax.transaction.xa.XAResource;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 
 /**
  * TransactionEnlistingInterceptor.java
@@ -33,6 +35,7 @@ import javax.transaction.xa.XAResource;
  * @version 1.0
  */
 public class TransactionEnlistingInterceptor implements ConnectionInterceptor {
+    protected static Log log = LogFactory.getLog(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.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.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/XAResourceInsertionInterceptor.java?rev=981012&r1=962417&r2=981012&view=diff
==============================================================================
--- geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/XAResourceInsertionInterceptor.java (original)
+++ geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/XAResourceInsertionInterceptor.java Sat Jul 31 06:59:52 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.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.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/transactionlog/LogXAResourceInsertionInterceptor.java?rev=981012&r1=962417&r2=981012&view=diff
==============================================================================
--- geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/transactionlog/LogXAResourceInsertionInterceptor.java (original)
+++ geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1.1/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/transactionlog/LogXAResourceInsertionInterceptor.java Sat Jul 31 06:59:52 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.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.1/geronimo-connector/src/test/java/org/apache/geronimo/connector/outbound/AbstractSinglePoolTest.java?rev=981012&r1=962417&r2=981012&view=diff
==============================================================================
--- geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1.1/geronimo-connector/src/test/java/org/apache/geronimo/connector/outbound/AbstractSinglePoolTest.java (original)
+++ geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1.1/geronimo-connector/src/test/java/org/apache/geronimo/connector/outbound/AbstractSinglePoolTest.java Sat Jul 31 06:59:52 2010
@@ -30,7 +30,7 @@ import junit.framework.TestCase;
 import org.apache.geronimo.connector.mock.MockManagedConnectionFactory;
 
 /**
- * @version $Rev:$ $Date:$
+ * @version $Rev$ $Date$
  */
 public class AbstractSinglePoolTest extends TestCase {
 
@@ -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.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.1/geronimo-connector/src/test/java/org/apache/geronimo/connector/outbound/ConnectionInterceptorTestUtils.java?rev=981012&r1=962417&r2=981012&view=diff
==============================================================================
--- geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1.1/geronimo-connector/src/test/java/org/apache/geronimo/connector/outbound/ConnectionInterceptorTestUtils.java (original)
+++ geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1.1/geronimo-connector/src/test/java/org/apache/geronimo/connector/outbound/ConnectionInterceptorTestUtils.java Sat Jul 31 06:59:52 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.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.1/geronimo-connector/src/test/java/org/apache/geronimo/connector/outbound/connectiontracking/ConnectionTrackingCoordinatorProxyTest.java?rev=981012&r1=962417&r2=981012&view=diff
==============================================================================
--- geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1.1/geronimo-connector/src/test/java/org/apache/geronimo/connector/outbound/connectiontracking/ConnectionTrackingCoordinatorProxyTest.java (original)
+++ geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1.1/geronimo-connector/src/test/java/org/apache/geronimo/connector/outbound/connectiontracking/ConnectionTrackingCoordinatorProxyTest.java Sat Jul 31 06:59:52 2010
@@ -283,6 +283,11 @@ public class ConnectionTrackingCoordinat
         return ci;
     }
 
+    public void info(StringBuilder s) {
+        s.append(getClass().getName()).append("\n");
+        s.append("<end>");
+    }
+
 
     public static interface Connection {
         String getString();

Modified: geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1.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.1/geronimo-connector/src/test/java/org/apache/geronimo/connector/outbound/connectiontracking/ConnectionTrackingCoordinatorTest.java?rev=981012&r1=962417&r2=981012&view=diff
==============================================================================
--- geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1.1/geronimo-connector/src/test/java/org/apache/geronimo/connector/outbound/connectiontracking/ConnectionTrackingCoordinatorTest.java (original)
+++ geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1.1/geronimo-connector/src/test/java/org/apache/geronimo/connector/outbound/connectiontracking/ConnectionTrackingCoordinatorTest.java Sat Jul 31 06:59:52 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.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.1/geronimo-transaction/src/main/java/org/apache/geronimo/transaction/log/XidImpl2.java?rev=981012&r1=962417&r2=981012&view=diff
==============================================================================
--- geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1.1/geronimo-transaction/src/main/java/org/apache/geronimo/transaction/log/XidImpl2.java (original)
+++ geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1.1/geronimo-transaction/src/main/java/org/apache/geronimo/transaction/log/XidImpl2.java Sat Jul 31 06:59:52 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.1/geronimo-transaction/src/main/java/org/apache/geronimo/transaction/manager/WrapperNamedXAResource.java
URL: http://svn.apache.org/viewvc/geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1.1/geronimo-transaction/src/main/java/org/apache/geronimo/transaction/manager/WrapperNamedXAResource.java?rev=981012&r1=962417&r2=981012&view=diff
==============================================================================
--- geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1.1/geronimo-transaction/src/main/java/org/apache/geronimo/transaction/manager/WrapperNamedXAResource.java (original)
+++ geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1.1/geronimo-transaction/src/main/java/org/apache/geronimo/transaction/manager/WrapperNamedXAResource.java Sat Jul 31 06:59:52 2010
@@ -21,7 +21,8 @@ import javax.transaction.xa.XAResource;
 import javax.transaction.xa.Xid;
 import javax.transaction.xa.XAException;
 
-import org.apache.geronimo.transaction.manager.NamedXAResource;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 
 /**
  *
@@ -30,6 +31,7 @@ import org.apache.geronimo.transaction.m
  *
  * */
 public class WrapperNamedXAResource implements NamedXAResource {
+    protected static Log log = LogFactory.getLog(WrapperNamedXAResource.class.getName());
 
     private final XAResource xaResource;
     private final String name;
@@ -48,6 +50,9 @@ public class WrapperNamedXAResource impl
     }
 
     public void end(Xid xid, int flags) throws XAException {
+        if (flags == XAResource.TMSUSPEND && log.isTraceEnabled()) {
+            log.trace("Suspend called on XAResource: " + getName(), new Exception("Stack trace"));
+        }
         xaResource.end(xid, flags);
     }
 

Modified: geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1.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.1/geronimo-transaction/src/main/java/org/apache/geronimo/transaction/manager/XidImpl.java?rev=981012&r1=962417&r2=981012&view=diff
==============================================================================
--- geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1.1/geronimo-transaction/src/main/java/org/apache/geronimo/transaction/manager/XidImpl.java (original)
+++ geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1.1/geronimo-transaction/src/main/java/org/apache/geronimo/transaction/manager/XidImpl.java Sat Jul 31 06:59:52 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();
     }

Modified: geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1.1/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1.1/pom.xml?rev=981012&r1=962417&r2=981012&view=diff
==============================================================================
--- geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1.1/pom.xml (original)
+++ geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1.1/pom.xml Sat Jul 31 06:59:52 2010
@@ -145,7 +145,7 @@
                             <rules>
                                 <!-- Allow any Java >= 1.5, but not 1.6 or above -->
                                 <requireJavaVersion>
-                                    <version>[1.5,1.6)</version>
+                                    <version>[1.5,1.7)</version>
                                 </requireJavaVersion>
                                 
                                 <!-- Allow any Maven >= 2.0.5 -->