[jboss-cvs] JBossCache/src/org/jboss/cache/interceptors ...

Manik Surtani msurtani at jboss.com
Mon Oct 16 06:55:40 EDT 2006


  User: msurtani
  Date: 06/10/16 06:55:40

  Modified:    src/org/jboss/cache/interceptors  
                        InvocationContextInterceptor.java
                        BaseTransactionalContextInterceptor.java
  Log:
  stuff
  
  Revision  Changes    Path
  1.7       +1 -1      JBossCache/src/org/jboss/cache/interceptors/InvocationContextInterceptor.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: InvocationContextInterceptor.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/interceptors/InvocationContextInterceptor.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -b -r1.6 -r1.7
  --- InvocationContextInterceptor.java	11 Oct 2006 13:56:31 -0000	1.6
  +++ InvocationContextInterceptor.java	16 Oct 2006 10:55:40 -0000	1.7
  @@ -73,7 +73,7 @@
            }
            else
            {
  -            if (ctx.getTransaction() != null && isValid(ctx.getTransaction()))
  +            if (ctx.getTransaction() != null && (isValid(ctx.getTransaction()) || isRollingBack(ctx.getTransaction())))
               {
                  copyInvocationScopeOptionsToTxScope(ctx);
               }
  
  
  
  1.2       +21 -0     JBossCache/src/org/jboss/cache/interceptors/BaseTransactionalContextInterceptor.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: BaseTransactionalContextInterceptor.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/interceptors/BaseTransactionalContextInterceptor.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -b -r1.1 -r1.2
  --- BaseTransactionalContextInterceptor.java	6 Sep 2006 17:58:20 -0000	1.1
  +++ BaseTransactionalContextInterceptor.java	16 Oct 2006 10:55:40 -0000	1.2
  @@ -7,6 +7,8 @@
   import org.jboss.cache.TransactionTable;
   import org.jboss.cache.config.Option;
   
  +import javax.transaction.Status;
  +import javax.transaction.SystemException;
   import javax.transaction.Transaction;
   import javax.transaction.TransactionManager;
   
  @@ -47,4 +49,23 @@
         ctx.setTransaction(tx);
         ctx.setGlobalTransaction(gtx);
      }
  +
  +   /**
  +    * Returns true if transaction is rolling back, false otherwise
  +    */
  +   protected boolean isRollingBack(Transaction tx)
  +   {
  +      if (tx == null) return false;
  +      int status = -1;
  +      try
  +      {
  +         status = tx.getStatus();
  +         return status == Status.STATUS_ROLLING_BACK || status == Status.STATUS_ROLLEDBACK;
  +      }
  +      catch (SystemException e)
  +      {
  +         log.error("failed getting transaction status", e);
  +         return false;
  +      }
  +   }
   }
  
  
  



More information about the jboss-cvs-commits mailing list