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

Manik Surtani msurtani at jboss.com
Tue Feb 27 16:57:36 EST 2007


  User: msurtani
  Date: 07/02/27 16:57:36

  Modified:    src/org/jboss/cache/interceptors    
                        CacheStoreInterceptor.java
                        PessimisticLockInterceptor.java
                        CacheLoaderInterceptor.java TxInterceptor.java
  Log:
  JBCACHE-814
  
  Revision  Changes    Path
  1.45      +2 -2      JBossCache/src/org/jboss/cache/interceptors/CacheStoreInterceptor.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: CacheStoreInterceptor.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/interceptors/CacheStoreInterceptor.java,v
  retrieving revision 1.44
  retrieving revision 1.45
  diff -u -b -r1.44 -r1.45
  --- CacheStoreInterceptor.java	7 Feb 2007 22:06:40 -0000	1.44
  +++ CacheStoreInterceptor.java	27 Feb 2007 21:57:36 -0000	1.45
  @@ -27,7 +27,7 @@
    * through the CacheLoader, either after each method call (no TXs), or at TX commit.
    *
    * @author Bela Ban
  - * @version $Id: CacheStoreInterceptor.java,v 1.44 2007/02/07 22:06:40 genman Exp $
  + * @version $Id: CacheStoreInterceptor.java,v 1.45 2007/02/27 21:57:36 msurtani Exp $
    */
   public class CacheStoreInterceptor extends BaseCacheLoaderInterceptor implements CacheStoreInterceptorMBean
   {
  @@ -76,7 +76,7 @@
   
         if (log.isTraceEnabled())
         {
  -         log.trace("CacheStoreInterceptor called with meth " + m);
  +         log.trace("CacheStoreInterceptor called with meth " + m.getMethod());
         }
   
         if (tx_mgr != null && tx_mgr.getTransaction() != null)
  
  
  
  1.49      +10 -12    JBossCache/src/org/jboss/cache/interceptors/PessimisticLockInterceptor.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: PessimisticLockInterceptor.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/interceptors/PessimisticLockInterceptor.java,v
  retrieving revision 1.48
  retrieving revision 1.49
  diff -u -b -r1.48 -r1.49
  --- PessimisticLockInterceptor.java	27 Feb 2007 17:27:44 -0000	1.48
  +++ PessimisticLockInterceptor.java	27 Feb 2007 21:57:36 -0000	1.49
  @@ -36,7 +36,7 @@
    * current method and unlock when the method returns.
    *
    * @author Bela Ban
  - * @version $Id: PessimisticLockInterceptor.java,v 1.48 2007/02/27 17:27:44 msurtani Exp $
  + * @version $Id: PessimisticLockInterceptor.java,v 1.49 2007/02/27 21:57:36 msurtani Exp $
    */
   public class PessimisticLockInterceptor extends Interceptor
   {
  @@ -209,6 +209,10 @@
            ((CacheImpl) cache).realRemove(fqn, true);
   
         }
  +      else if (m.getMethodId() == MethodDeclarations.commitMethod_id || isOnePhaseCommitPrepareMehod(m) || m.getMethodId() == MethodDeclarations.rollbackMethod_id)
  +      {
  +         cleanup(ctx.getGlobalTransaction());
  +      }
         return o;
      }
   
  @@ -495,7 +499,11 @@
            Fqn f = (Fqn) removedNodes.next();
            tcpi.realRemove(f, false);
         }
  +   }
   
  +   private void cleanup(GlobalTransaction gtx)
  +   {
  +      TransactionEntry entry = tx_table.get(gtx);
         // Let's do it in stack style, LIFO
         entry.releaseAllLocksLIFO(gtx);
   
  @@ -508,7 +516,6 @@
         tx_table.remove(gtx);
      }
   
  -
      /**
       * Revert all changes made inside this TX: invoke all method calls of the undo-ops
       * list. Then release all locks and remove the TX from the transaction table.
  @@ -566,15 +573,6 @@
         // 3. Finally, release all locks held by this TX
         // Let's do it in stack style, LIFO
         // Note that the lock could have been released already so don't panic.
  -      entry.releaseAllLocksLIFO(tx);
  -
  -      Transaction ltx = entry.getTransaction();
  -      if (log.isTraceEnabled())
  -      {
  -         log.trace("removing local transaction " + ltx + " and global transaction " + tx);
  -      }
  -      tx_table.remove(ltx);
  -      tx_table.remove(tx);
      }
   
      private static class LockManager
  
  
  
  1.78      +4 -2      JBossCache/src/org/jboss/cache/interceptors/CacheLoaderInterceptor.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: CacheLoaderInterceptor.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/interceptors/CacheLoaderInterceptor.java,v
  retrieving revision 1.77
  retrieving revision 1.78
  diff -u -b -r1.77 -r1.78
  --- CacheLoaderInterceptor.java	7 Feb 2007 22:06:40 -0000	1.77
  +++ CacheLoaderInterceptor.java	27 Feb 2007 21:57:36 -0000	1.78
  @@ -28,7 +28,7 @@
    * Loads nodes that don't exist at the time of the call into memory from the CacheLoader
    *
    * @author Bela Ban
  - * @version $Id: CacheLoaderInterceptor.java,v 1.77 2007/02/07 22:06:40 genman Exp $
  + * @version $Id: CacheLoaderInterceptor.java,v 1.78 2007/02/27 21:57:36 msurtani Exp $
    */
   public class CacheLoaderInterceptor extends BaseCacheLoaderInterceptor implements CacheLoaderInterceptorMBean
   {
  @@ -331,7 +331,9 @@
   
         MethodCall m = MethodCallFactory.create(MethodDeclarations.lockMethodLocal,
                 fqn, lock_type, recursive);
  -      super.invoke(m);
  +      // hacky
  +      cache.getInterceptorChain().get(0).invoke(m);
  +//      super.invoke(m);
      }
   
      /**
  
  
  
  1.78      +2 -0      JBossCache/src/org/jboss/cache/interceptors/TxInterceptor.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: TxInterceptor.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/interceptors/TxInterceptor.java,v
  retrieving revision 1.77
  retrieving revision 1.78
  diff -u -b -r1.77 -r1.78
  --- TxInterceptor.java	7 Feb 2007 22:06:40 -0000	1.77
  +++ TxInterceptor.java	27 Feb 2007 21:57:36 -0000	1.78
  @@ -1035,6 +1035,7 @@
            super(gtx, tx, cache);
         }
   
  +      @Override
         public void beforeCompletion()
         {
            super.beforeCompletion();
  @@ -1089,6 +1090,7 @@
            }
         }
   
  +      @Override
         public void afterCompletion(int status)
         {
            cache.getInvocationContext().setLocalRollbackOnly(localRollbackOnly);
  
  
  



More information about the jboss-cvs-commits mailing list