[jboss-cvs] JBossAS SVN: r77841 - trunk/server/src/main/org/jboss/tm/usertx/client.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Sep 3 10:06:20 EDT 2008


Author: galder.zamarreno at jboss.com
Date: 2008-09-03 10:06:20 -0400 (Wed, 03 Sep 2008)
New Revision: 77841

Modified:
   trunk/server/src/main/org/jboss/tm/usertx/client/ClientUserTransaction.java
Log:
[JBAS-5904] Added some trace logging in case anyone needs them when debugging this area.

Modified: trunk/server/src/main/org/jboss/tm/usertx/client/ClientUserTransaction.java
===================================================================
--- trunk/server/src/main/org/jboss/tm/usertx/client/ClientUserTransaction.java	2008-09-03 13:50:14 UTC (rev 77840)
+++ trunk/server/src/main/org/jboss/tm/usertx/client/ClientUserTransaction.java	2008-09-03 14:06:20 UTC (rev 77841)
@@ -46,6 +46,7 @@
 
 import org.jboss.tm.usertx.interfaces.UserTransactionSession;
 import org.jboss.tm.usertx.interfaces.UserTransactionSessionFactory;
+import org.jboss.logging.Logger;
 import org.jboss.naming.NamingContextFactory;
 
 /**
@@ -77,6 +78,10 @@
     */
    private static ClientUserTransaction singleton = new ClientUserTransaction();
 
+   private static final Logger log = Logger.getLogger(ClientUserTransaction.class);
+
+   private static boolean trace = log.isTraceEnabled();   
+   
    /**
     * Return a reference to the singleton instance.
     * 
@@ -397,6 +402,12 @@
          ret = new ThreadInfo();
          threadInfo.set(ret);
       }
+      
+      if (trace)
+      {
+         log.trace("Thread local: " + threadInfo); 
+         log.trace("Thread info holder: " + ret);
+      }
 
       return ret;
    }
@@ -430,6 +441,11 @@
       protected void finalize()
          throws Throwable
       {
+         if (trace)
+         {
+            log.trace("Tpc stack: finalize " + this);
+         }
+         
          try
          {
             while (!tpcStack.isEmpty())
@@ -460,6 +476,11 @@
       void push(Object tpc)
       {
          tpcStack.addLast(tpc);
+         trace = log.isTraceEnabled(); // Only check for trace enabled once per transaction
+         if (trace)
+         {
+            log.trace("Tpc stack: added " + this + " tpc=" + tpc);
+         }
       }
 
       /**
@@ -468,6 +489,10 @@
       void pop()
       {
          tpcStack.removeLast();
+         if (trace)
+         {
+            log.trace("Tpc stack: removed " + this + " tpc=" + tpc);
+         }
       }
 
       /**
@@ -475,7 +500,12 @@
        */
       Object getTpc()
       {
-         return (tpcStack.isEmpty()) ? null : tpcStack.getLast();
+         Object tpc = (tpcStack.isEmpty()) ? null : tpcStack.getLast();
+         if (trace)
+         {
+            log.trace("Tpc stack: peek " + this + " tpc=" + tpc);
+         }
+         return tpc;
       }
 
       /**




More information about the jboss-cvs-commits mailing list