[jboss-cvs] JBossAS SVN: r77843 - branches/Branch_4_2/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:26:01 EDT 2008


Author: galder.zamarreno at jboss.com
Date: 2008-09-03 10:26:01 -0400 (Wed, 03 Sep 2008)
New Revision: 77843

Modified:
   branches/Branch_4_2/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: branches/Branch_4_2/server/src/main/org/jboss/tm/usertx/client/ClientUserTransaction.java
===================================================================
--- branches/Branch_4_2/server/src/main/org/jboss/tm/usertx/client/ClientUserTransaction.java	2008-09-03 14:07:34 UTC (rev 77842)
+++ branches/Branch_4_2/server/src/main/org/jboss/tm/usertx/client/ClientUserTransaction.java	2008-09-03 14:26:01 UTC (rev 77843)
@@ -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;
 
 /**
@@ -60,6 +61,7 @@
  * here.
  * @author <a href="mailto:osh at sparre.dk">Ole Husgaard</a>
  * @author Scott.Stark at jboss.org
+ * @author <a href="mailto:galder.zamarreno at jboss.com">Galder Zamarreno</a>
  * @version $Revision$
  */
 public class ClientUserTransaction
@@ -77,6 +79,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.
     * 
@@ -398,6 +404,12 @@
          threadInfo.set(ret);
       }
 
+      if (trace)
+      {
+         log.trace("Thread local: " + threadInfo); 
+         log.trace("Thread info holder: " + ret);
+      }      
+      
       return ret;
    }
 
@@ -430,6 +442,11 @@
       protected void finalize()
          throws Throwable
       {
+         if (trace)
+         {
+            log.trace("Tpc stack: finalize " + this);
+         }
+         
          try
          {
             while (!tpcStack.isEmpty())
@@ -459,6 +476,11 @@
        */
       void push(Object tpc)
       {
+         trace = log.isTraceEnabled(); // Only check for trace enabled once per transaction
+         if (trace)
+         {
+            log.trace("Tpc stack: added " + this + " tpc=" + tpc);
+         }
          tpcStack.addLast(tpc);
       }
 
@@ -467,7 +489,11 @@
        */
       void pop()
       {
-         tpcStack.removeLast();
+         Object tpc = tpcStack.removeLast();
+         if (trace)
+         {
+            log.trace("Tpc stack: removed " + this + " tpc=" + tpc);
+         }
       }
 
       /**
@@ -475,7 +501,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