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

Manik Surtani msurtani at jboss.com
Fri Feb 9 08:49:35 EST 2007


  User: msurtani
  Date: 07/02/09 08:49:35

  Modified:    src/org/jboss/cache/interceptors  Tag:
                        Branch_JBossCache_1_4_0
                        PessimisticLockInterceptor.java
  Log:
  JBCACHE-974
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.20.2.10 +16 -2     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.20.2.9
  retrieving revision 1.20.2.10
  diff -u -b -r1.20.2.9 -r1.20.2.10
  --- PessimisticLockInterceptor.java	30 Jan 2007 03:20:16 -0000	1.20.2.9
  +++ PessimisticLockInterceptor.java	9 Feb 2007 13:49:35 -0000	1.20.2.10
  @@ -36,7 +36,7 @@
    * current method and unlock when the method returns.
    *
    * @author Bela Ban
  - * @version $Id: PessimisticLockInterceptor.java,v 1.20.2.9 2007/01/30 03:20:16 bstansberry Exp $
  + * @version $Id: PessimisticLockInterceptor.java,v 1.20.2.10 2007/02/09 13:49:35 msurtani Exp $
    */
   public class PessimisticLockInterceptor extends Interceptor
   {
  @@ -316,7 +316,21 @@
   
      private boolean needToReverseRemove(DataNode n, TransactionEntry te, int lockTypeRequested, boolean isRemoveOperation, boolean createIfNotExists)
      {
  -      return !isRemoveOperation && createIfNotExists && lockTypeRequested == DataNode.LOCK_TYPE_WRITE && n.isMarkedForRemoval() && te.getRemovedNodes().contains(n.getFqn());
  +      return !isRemoveOperation && createIfNotExists && lockTypeRequested == DataNode.LOCK_TYPE_WRITE && n.isMarkedForRemoval()
  +              && hasBeenRemovedInCurrentTx(te, n.getFqn());
  +   }
  +
  +   private boolean hasBeenRemovedInCurrentTx(TransactionEntry te, Fqn f)
  +   {
  +      if (te.getRemovedNodes().contains(f)) return true;
  +
  +      Iterator i = te.getRemovedNodes().iterator();
  +      while (i.hasNext())
  +      {
  +         Fqn removed = (Fqn) i.next();
  +         if (f.isChildOf(removed)) return true;
  +      }
  +      return false;
      }
   
      private void reverseRemove(DataNode n)
  
  
  



More information about the jboss-cvs-commits mailing list