XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Critical
    • JBossAS-4.0.5.GA
    • JBossAS-4.0.5.CR1
    • Other
    • None

    Description

      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); }

        }
        }

      Attachments

        Activity

          People

            kkhan1@redhat.com Kabir Khan
            kconner@redhat.com Kevin Conner (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: