[jboss-jira] [JBoss JIRA] Created: (JBAS-3685) References to TxManager

Kevin Conner (JIRA) jira-events at jboss.com
Fri Sep 22 00:35:00 EDT 2006


References to TxManager
-----------------------

                 Key: JBAS-3685
                 URL: http://jira.jboss.com/jira/browse/JBAS-3685
             Project: JBoss Application Server
          Issue Type: Bug
      Security Level: Public (Everyone can see)
          Components: Other
    Affects Versions: JBossAS-4.0.5.CR1
            Reporter: Kevin Conner
            Priority: Critical


The following class contains direct references to org.jboss.tm.TxManager. These references prevent JBossTS being used as a replacement for TxManager.

   aspects/src/main/org/jboss/aspects/tx/TxInterceptor.java

These should be changed to refer to the TransactionTimeoutConfiguration interface instead of TxManager.

Index: aspects/src/main/org/jboss/aspects/tx/TxInterceptor.java
===================================================================
--- aspects/src/main/org/jboss/aspects/tx/TxInterceptor.java    (revision 57055)+++ aspects/src/main/org/jboss/aspects/tx/TxInterceptor.java    (working copy)
@@ -26,6 +26,7 @@
 import org.jboss.aop.advice.Interceptor;
 import org.jboss.aop.joinpoint.Invocation;
 import org.jboss.logging.Logger;
+import org.jboss.tm.TransactionTimeoutConfiguration;

 /**
  * This interceptor handles transactions for AOP
@@ -174,20 +175,18 @@

       public Object invoke(Invocation invocation) throws Throwable
       {
-         org.jboss.tm.TxManager txManager = (org.jboss.tm.TxManager)tm;
          int oldTimeout = 0;

-         if (tm instanceof org.jboss.tm.TxManager)
+         if (tm instanceof TransactionTimeoutConfiguration)
          {
-            txManager = (org.jboss.tm.TxManager)tm;
-            oldTimeout = txManager.getTransactionTimeout();
+            oldTimeout = ((TransactionTimeoutConfiguration)tm).getTransactionTimeout();
          }

          try
          {
-            if (timeout != -1 && txManager != null)
+            if (timeout != -1 && tm != null)
             {
-               txManager.setTransactionTimeout(timeout);
+               tm.setTransactionTimeout(timeout);
             }

             Transaction tx = tm.getTransaction();
@@ -203,9 +202,9 @@
          }
          finally
          {
-            if (txManager != null)
+            if (tm != null)
             {
-               txManager.setTransactionTimeout(oldTimeout);
+               tm.setTransactionTimeout(oldTimeout);
             }
          }
       }
@@ -241,20 +240,18 @@

       public Object invoke(Invocation invocation) throws Throwable
       {
-         org.jboss.tm.TxManager txManager = (org.jboss.tm.TxManager)tm;
          int oldTimeout = 0;

-         if (tm instanceof org.jboss.tm.TxManager)
+         if (tm instanceof TransactionTimeoutConfiguration)
          {
-            txManager = (org.jboss.tm.TxManager)tm;
-            oldTimeout = txManager.getTransactionTimeout();
+            oldTimeout = ((TransactionTimeoutConfiguration)tm).getTransactionTimeout();
          }

          try
          {
-            if (timeout != -1 && txManager != null)
+            if (timeout != -1 && tm != null)
             {
-               txManager.setTransactionTimeout(timeout);
+               tm.setTransactionTimeout(timeout);
             }

             Transaction tx = tm.getTransaction();
@@ -277,9 +274,9 @@
          }
          finally
          {
-            if (txManager != null)
+            if (tm != null)
             {
-               txManager.setTransactionTimeout(oldTimeout);
+               tm.setTransactionTimeout(oldTimeout);
             }
          }
       }


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list