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

Manik Surtani msurtani at jboss.com
Wed Dec 6 05:57:53 EST 2006


  User: msurtani
  Date: 06/12/06 05:57:53

  Modified:    src/org/jboss/cache/interceptors  Tag:
                        Branch_JBossCache_1_3_0
                        PessimisticLockInterceptor.java
  Log:
  fixed problem with recreating nodes after deletion
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.14.2.10 +4 -4      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.14.2.9
  retrieving revision 1.14.2.10
  diff -u -b -r1.14.2.9 -r1.14.2.10
  --- PessimisticLockInterceptor.java	5 Dec 2006 17:25:45 -0000	1.14.2.9
  +++ PessimisticLockInterceptor.java	6 Dec 2006 10:57:53 -0000	1.14.2.10
  @@ -34,7 +34,7 @@
    * scope of the TX. When no TX is present, we keep track of the locks acquired during the current method and unlock
    * when the method returns
    * @author Bela Ban
  - * @version $Id: PessimisticLockInterceptor.java,v 1.14.2.9 2006/12/05 17:25:45 msurtani Exp $
  + * @version $Id: PessimisticLockInterceptor.java,v 1.14.2.10 2006/12/06 10:57:53 msurtani Exp $
    */
   public class PessimisticLockInterceptor extends Interceptor {
      TransactionTable           tx_table=null;
  @@ -244,7 +244,7 @@
            }
   
            // reverse the "remove" if the node has been previously removed in the same tx, if this operation is a put()
  -         if (needToReverseRemove(child_node, tx_table.get(gtx), lock_type, isRemoveNodeOperation))
  +         if (needToReverseRemove(child_node, tx_table.get(gtx), lock_type, isRemoveNodeOperation, createIfNotExists))
            {
               reverseRemove(child_node);
            }
  @@ -275,9 +275,9 @@
         if (isRemoveNodeOperation && gtx != null) cache.getTransactionTable().get(gtx).addRemovedNode(fqn);
      }
   
  -   private boolean needToReverseRemove(DataNode n, TransactionEntry te, int lockTypeRequested, boolean isRemoveOperation)
  +   private boolean needToReverseRemove(DataNode n, TransactionEntry te, int lockTypeRequested, boolean isRemoveOperation, boolean createIfNotExists)
      {
  -      return !isRemoveOperation && lockTypeRequested == DataNode.LOCK_TYPE_WRITE && cache.isMarkedForRemoval(n) && te.getRemovedNodes().contains(n.getFqn());
  +      return !isRemoveOperation && createIfNotExists && lockTypeRequested == DataNode.LOCK_TYPE_WRITE && cache.isMarkedForRemoval(n) && te.getRemovedNodes().contains(n.getFqn());
      }
   
      private void reverseRemove(DataNode n)
  
  
  



More information about the jboss-cvs-commits mailing list