[jbosscache-commits] JBoss Cache SVN: r6154 - in core/trunk/src: main/java/org/jboss/cache/interceptors and 4 other directories.

jbosscache-commits at lists.jboss.org jbosscache-commits at lists.jboss.org
Wed Jul 2 13:34:40 EDT 2008


Author: manik.surtani at jboss.com
Date: 2008-07-02 13:34:40 -0400 (Wed, 02 Jul 2008)
New Revision: 6154

Removed:
   core/trunk/src/test/java/org/jboss/cache/api/mvcc/read_committed/ReadCommittedWithParentLockTest.java
   core/trunk/src/test/java/org/jboss/cache/api/mvcc/repeatable_read/RepeatableReadNoWriteSkewWithParentLockTest.java
   core/trunk/src/test/java/org/jboss/cache/api/mvcc/repeatable_read/RepeatableReadWriteSkewWithParentLockTest.java
Modified:
   core/trunk/src/main/java/org/jboss/cache/commands/write/EvictCommand.java
   core/trunk/src/main/java/org/jboss/cache/interceptors/MVCCLockingInterceptor.java
   core/trunk/src/main/java/org/jboss/cache/mvcc/NodeReference.java
   core/trunk/src/main/java/org/jboss/cache/mvcc/NullMarkerNode.java
   core/trunk/src/main/java/org/jboss/cache/mvcc/ReadCommittedNode.java
   core/trunk/src/main/java/org/jboss/cache/mvcc/RepeatableReadNode.java
   core/trunk/src/test/java/org/jboss/cache/api/mvcc/LockTestBase.java
   core/trunk/src/test/java/org/jboss/cache/api/mvcc/read_committed/ReadCommittedLockTest.java
   core/trunk/src/test/java/org/jboss/cache/api/mvcc/repeatable_read/NodeAPIMVCCTest.java
   core/trunk/src/test/java/org/jboss/cache/api/mvcc/repeatable_read/RepeatableReadNoWriteSkewLockTest.java
   core/trunk/src/test/java/org/jboss/cache/api/mvcc/repeatable_read/RepeatableReadWriteSkewLockTest.java
Log:
MVCC to lock parents always

Modified: core/trunk/src/main/java/org/jboss/cache/commands/write/EvictCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/write/EvictCommand.java	2008-07-02 13:39:16 UTC (rev 6153)
+++ core/trunk/src/main/java/org/jboss/cache/commands/write/EvictCommand.java	2008-07-02 17:34:40 UTC (rev 6154)
@@ -71,7 +71,7 @@
    {
       // TODO: remove this ugly hack
       NodeSPI node = lookupForEviction(ctx, fqn);
-      if (node == null)
+      if (node == null || node.isDeleted())
       {
          return false;
       }

Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/MVCCLockingInterceptor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/interceptors/MVCCLockingInterceptor.java	2008-07-02 13:39:16 UTC (rev 6153)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/MVCCLockingInterceptor.java	2008-07-02 17:34:40 UTC (rev 6154)
@@ -1,5 +1,6 @@
 package org.jboss.cache.interceptors;
 
+import org.jboss.cache.CacheException;
 import org.jboss.cache.DataContainer;
 import org.jboss.cache.Fqn;
 import org.jboss.cache.NodeFactory;
@@ -33,6 +34,7 @@
 import static org.jboss.cache.lock.LockType.WRITE;
 import org.jboss.cache.lock.TimeoutException;
 import org.jboss.cache.mvcc.InternalNode;
+import org.jboss.cache.mvcc.NullMarkerNode;
 import org.jboss.cache.mvcc.ReadCommittedNode;
 
 import java.util.ArrayList;
@@ -58,7 +60,7 @@
 
    // How will wrapper nodes unwrap?
 
-   boolean allowWriteSkew, lockParentForChildInsertRemove;
+   boolean allowWriteSkew;
    LockManager lockManager;
    DataContainer dataContainer;
    NodeFactory nodeFactory;
@@ -76,7 +78,6 @@
    public void start()
    {
       allowWriteSkew = configuration.isAllowWriteSkew();
-      lockParentForChildInsertRemove = configuration.isLockParentForChildInsertRemove();
       defaultLockAcquisitionTimeout = configuration.getLockAcquisitionTimeout();
    }
 
@@ -104,31 +105,83 @@
    @Override
    public Object handleRemoveNodeCommand(InvocationContext ctx, RemoveNodeCommand command) throws Throwable
    {
+      addNodeAndParentForRemoval(ctx, command.getFqn(), true);
+      return invokeNextInterceptor(ctx, command);
+   }
+
+   private List<Fqn> addNodeAndParentForRemoval(InvocationContext ctx, Fqn nodeFqn, boolean recursive) throws InterruptedException
+   {
       // when removing a node we want to get a lock on the Fqn anyway and return the wrapped node.
-      Fqn nodeFqn = command.getFqn();
+      if (nodeFqn.isRoot()) throw new CacheException("Attempting to remove Fqn.ROOT!");
 
-      if (!nodeFqn.isRoot())
+      Fqn parentFqn = nodeFqn.getParent();
+      // inspect parent
+      boolean needToCopyParent = lock(ctx, parentFqn);
+
+      // Ensure the node is in the context.
+      putNodeInContext(ctx, parentFqn, needToCopyParent);
+
+      boolean needToCopyNode = lock(ctx, nodeFqn);
+
+      // Ensure the node is in the context.
+      putNodeInContext(ctx, nodeFqn, needToCopyNode);
+
+      ReadCommittedNode node = (ReadCommittedNode) ctx.lookUpNode(nodeFqn);
+
+      // update child ref on parent to point to child as this is now a copy.
+      if (node != null && !(node instanceof NullMarkerNode))
       {
-         Fqn parentFqn = nodeFqn.getParent();
-         // inspect parent
-         InternalNode parent = dataContainer.peekInternalNode(parentFqn, false);
+         if (needToCopyNode || needToCopyParent)
          {
-            if (lockParentForChildInsertRemove || (parent != null && parent.isLockForChildInsertRemove()))
+
+            ReadCommittedNode parent = (ReadCommittedNode) ctx.lookUpNode(parentFqn);
+            parent.addChildDirect(nodeFactory.createNodeInvocationDelegate((InternalNode) node.getDelegationTarget()));
+         }
+
+         // now deal with children.
+         if (recursive)
+         {
+            Map childMap = node.getChildrenMapDirect();
+            List<Fqn> fqnsToBeRemoved = new LinkedList<Fqn>();
+            fqnsToBeRemoved.add(nodeFqn);
+            if (childMap == null || childMap.isEmpty()) return fqnsToBeRemoved;
+
+            for (Object n : childMap.values())
             {
-               boolean needToCopyNode = lock(ctx, parentFqn);
+               NodeSPI child = (NodeSPI) n;
+               lockForRemoval(child.getFqn(), recursive, ctx, fqnsToBeRemoved);
+            }
 
-               // Ensure the node is in the context.
-               putNodeInContext(ctx, parentFqn, needToCopyNode);
-            }
+            return fqnsToBeRemoved;
          }
       }
 
-      boolean needToCopyNode = lock(ctx, nodeFqn);
+      return null;
+   }
 
-      // Ensure the node is in the context.
-      putNodeInContext(ctx, nodeFqn, needToCopyNode);
+   private void lockForRemoval(Fqn fqn, boolean isRecursive, InvocationContext ctx, List<Fqn> fqnList) throws InterruptedException
+   {
+      lock(ctx, fqn); // lock node
+      if (fqnList != null) fqnList.add(fqn);
 
-      return invokeNextInterceptor(ctx, command);
+      // now wrap and add to the context
+      ReadCommittedNode rcn = (ReadCommittedNode) getWrappedNode(ctx, fqn, true, false, true);
+      if (rcn != null)
+      {
+         rcn.copyNodeForUpdate(dataContainer, allowWriteSkew, ctx, nodeFactory);
+
+         if (isRecursive)
+         {
+            Map<Object, NodeSPI> children = rcn.getChildrenMapDirect();
+            if (children != null)
+            {
+               for (NodeSPI child : children.values())
+               {
+                  lockForRemoval(child.getFqn(), isRecursive, ctx, fqnList);
+               }
+            }
+         }
+      }
    }
 
    private void putNodeInContext(InvocationContext ctx, Fqn fqn, boolean needToCopyNode)
@@ -143,7 +196,7 @@
 
       if (needToCopyNode && node != null && !node.isChanged()) // node could be null if using read-committed
       {
-         node.copyNodeForUpdate(dataContainer, allowWriteSkew, ctx, nodeFactory, lockParentForChildInsertRemove);
+         node.copyNodeForUpdate(dataContainer, allowWriteSkew, ctx, nodeFactory);
       }
    }
 
@@ -159,33 +212,8 @@
    {
       // set lock acquisition timeout to 0 - we need to fail fast.
       ctx.getOptionOverrides().setLockAcquisitionTimeout(0);
+      List<Fqn> fqnsToEvict = addNodeAndParentForRemoval(ctx, command.getFqn(), command.isRecursive());
 
-      // similar to remove node, except that we need to take care of the recursive case.
-      Fqn nodeFqn = command.getFqn();
-
-      if (!nodeFqn.isRoot())
-      {
-         Fqn parentFqn = nodeFqn.getParent();
-         // inspect parent
-         InternalNode parent = dataContainer.peekInternalNode(parentFqn, true);
-         {
-            if (lockParentForChildInsertRemove || (parent != null && parent.isLockForChildInsertRemove()))
-            {
-               // lock parent
-               lockManager.lockAndRecord(parentFqn, WRITE, ctx);
-
-               // retrieve again from the dataContainer in case we have a race, and add to the context
-               ReadCommittedNode rcn = (ReadCommittedNode) getWrappedNode(ctx, parentFqn, true, false, false);
-               if (rcn != null)
-                  rcn.copyNodeForUpdate(dataContainer, allowWriteSkew, ctx, nodeFactory, lockParentForChildInsertRemove);
-            }
-         }
-      }
-
-      List<Fqn> fqnsToEvict = command.isRecursive() ? new LinkedList<Fqn>() : null;
-
-      lockForEviction(nodeFqn, command.isRecursive(), ctx, fqnsToEvict);
-
       if (fqnsToEvict != null) // add this set to the command
       {
          command.setNodesToEvict(fqnsToEvict);
@@ -194,31 +222,6 @@
       return invokeNextInterceptor(ctx, command);
    }
 
-   private void lockForEviction(Fqn fqn, boolean isRecursive, InvocationContext ctx, List<Fqn> fqnsToEvict) throws InterruptedException
-   {
-      lockManager.lockAndRecord(fqn, WRITE, ctx); // lock node.
-      if (fqnsToEvict != null) fqnsToEvict.add(fqn);
-
-      // now wrap and add to the context
-      ReadCommittedNode rcn = (ReadCommittedNode) getWrappedNode(ctx, fqn, true, false, true);
-      if (rcn != null)
-      {
-         rcn.copyNodeForUpdate(dataContainer, allowWriteSkew, ctx, nodeFactory, lockParentForChildInsertRemove);
-
-         if (isRecursive)
-         {
-            Map<Object, NodeSPI> children = rcn.getChildrenMapDirect();
-            if (children != null)
-            {
-               for (NodeSPI child : children.values())
-               {
-                  lockForEviction(child.getFqn(), isRecursive, ctx, fqnsToEvict);
-               }
-            }
-         }
-      }
-   }
-
    @Override
    public Object handleInvalidateCommand(InvocationContext ctx, InvalidateCommand command) throws Throwable
    {
@@ -340,8 +343,7 @@
             {
                // for each of these, swap refs
                ReadCommittedNode rcn = (ReadCommittedNode) ctx.lookUpNode(fqnsToUnlock[i]);
-//               rcn.copyNodeForUpdate(dataContainer, allowWriteSkew);
-               rcn.commitUpdate(dataContainer, nodeFactory);
+               if (rcn != null) rcn.commitUpdate(dataContainer, nodeFactory); // could be null with read-committed
                // and then unlock
                lockManager.unlock(fqnsToUnlock[i], owner);
             }
@@ -462,7 +464,7 @@
          if (lockForWriting && lock(context, fqn))
          {
             // create a copy of the underlying node
-            n.copyNodeForUpdate(dataContainer, allowWriteSkew, context, nodeFactory, lockParentForChildInsertRemove);
+            n.copyNodeForUpdate(dataContainer, allowWriteSkew, context, nodeFactory);
          }
          if (trace) log.trace("Retrieving wrapped node " + fqn);
          return n;
@@ -481,7 +483,7 @@
          ReadCommittedNode wrapped = nodeFactory.createMvccNode(in);
          context.putLookedUpNode(fqn, wrapped);
          if (needToCopy)
-            wrapped.copyNodeForUpdate(dataContainer, allowWriteSkew, context, nodeFactory, lockParentForChildInsertRemove);
+            wrapped.copyNodeForUpdate(dataContainer, allowWriteSkew, context, nodeFactory);
          return wrapped;
       }
 
@@ -491,14 +493,11 @@
          Fqn parentFqn = fqn.getParent();
          NodeSPI parent = getWrappedNode(context, parentFqn, false, createIfAbsent, false);
          // do we need to lock the parent to create children?
-         if (lockParentForChildInsertRemove || parent.isLockForChildInsertRemove())
+         // get a lock on the parent.
+         if (lock(context, parentFqn))
          {
-            // get a lock on the parent.
-            if (lock(context, parentFqn))
-            {
-               ReadCommittedNode parentRCN = (ReadCommittedNode) context.lookUpNode(parentFqn);
-               parentRCN.copyNodeForUpdate(dataContainer, allowWriteSkew, context, nodeFactory, lockParentForChildInsertRemove);
-            }
+            ReadCommittedNode parentRCN = (ReadCommittedNode) context.lookUpNode(parentFqn);
+            parentRCN.copyNodeForUpdate(dataContainer, allowWriteSkew, context, nodeFactory);
          }
 
          // now to lock and create the node.
@@ -508,7 +507,10 @@
          in = (InternalNode) ((NodeInvocationDelegate) temp).getDelegationTarget();
          ReadCommittedNode wrapped = nodeFactory.createMvccNode(in);
          context.putLookedUpNode(fqn, wrapped);
-         wrapped.copyNodeForUpdate(dataContainer, allowWriteSkew, context, nodeFactory, lockParentForChildInsertRemove);
+         wrapped.copyNodeForUpdate(dataContainer, allowWriteSkew, context, nodeFactory);
+         // since we copied the child make sure we update the parent's ref
+         parent.addChildDirect(nodeFactory.createNodeInvocationDelegate(wrapped.getNode()));
+
          return wrapped;
       }
 

Modified: core/trunk/src/main/java/org/jboss/cache/mvcc/NodeReference.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/mvcc/NodeReference.java	2008-07-02 13:39:16 UTC (rev 6153)
+++ core/trunk/src/main/java/org/jboss/cache/mvcc/NodeReference.java	2008-07-02 17:34:40 UTC (rev 6154)
@@ -281,4 +281,12 @@
    {
       delegate.printDetails(sb, indent);
    }
+
+   @Override
+   public String toString()
+   {
+      return "NodeReference{" +
+            "delegate=" + delegate +
+            '}';
+   }
 }

Modified: core/trunk/src/main/java/org/jboss/cache/mvcc/NullMarkerNode.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/mvcc/NullMarkerNode.java	2008-07-02 13:39:16 UTC (rev 6153)
+++ core/trunk/src/main/java/org/jboss/cache/mvcc/NullMarkerNode.java	2008-07-02 17:34:40 UTC (rev 6154)
@@ -36,7 +36,7 @@
    }
 
    @Override
-   public void copyNodeForUpdate(DataContainer d, boolean b, InvocationContext ctx, NodeFactory nodeFactory, boolean lockParent)
+   public void copyNodeForUpdate(DataContainer d, boolean b, InvocationContext ctx, NodeFactory nodeFactory)
    {
       // no op
    }

Modified: core/trunk/src/main/java/org/jboss/cache/mvcc/ReadCommittedNode.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/mvcc/ReadCommittedNode.java	2008-07-02 13:39:16 UTC (rev 6153)
+++ core/trunk/src/main/java/org/jboss/cache/mvcc/ReadCommittedNode.java	2008-07-02 17:34:40 UTC (rev 6154)
@@ -30,7 +30,7 @@
       return false;
    }
 
-   public void copyNodeForUpdate(DataContainer container, boolean allowWriteSkew, InvocationContext ctx, NodeFactory nodeFactory, boolean lockParent)
+   public void copyNodeForUpdate(DataContainer container, boolean allowWriteSkew, InvocationContext ctx, NodeFactory nodeFactory)
    {
       changed = true;
       backup = node;
@@ -52,16 +52,25 @@
 
    protected void updateNode(DataContainer container, NodeFactory nf)
    {
-      // TODO: Deal with creating - what if children is null?
-
       if (isDeleted())
       {
          Fqn fqn = getFqn();
-         NodeSPI parent = container.peek(fqn);
-         if (parent != null)
+         if (!fqn.isRoot())
          {
-            parent.removeChildDirect(fqn.getLastElement());
+            NodeSPI parent = container.peek(fqn.getParent());
+            if (parent != null)
+            {
+               parent.removeChildDirect(fqn.getLastElement());
+            }
+            else
+            {
+               if (trace) log.trace("Parent is null in the underlying cache; cannot remove.");
+            }
          }
+         else
+         {
+            log.warn("Attempting to remove the root node.  Not doing anything!");
+         }
       }
       else
       {
@@ -86,4 +95,14 @@
    {
       this.changed = changed;
    }
+
+   public InternalNode getNode()
+   {
+      return node;
+   }
+
+   public InternalNode getBackupNode()
+   {
+      return backup;
+   }
 }

Modified: core/trunk/src/main/java/org/jboss/cache/mvcc/RepeatableReadNode.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/mvcc/RepeatableReadNode.java	2008-07-02 13:39:16 UTC (rev 6153)
+++ core/trunk/src/main/java/org/jboss/cache/mvcc/RepeatableReadNode.java	2008-07-02 17:34:40 UTC (rev 6154)
@@ -23,7 +23,7 @@
    }
 
    @Override
-   public void copyNodeForUpdate(DataContainer container, boolean allowWriteSkew, InvocationContext ctx, NodeFactory nodeFactory, boolean lockParent)
+   public void copyNodeForUpdate(DataContainer container, boolean allowWriteSkew, InvocationContext ctx, NodeFactory nodeFactory)
    {
       Fqn fqn = getFqn();
 
@@ -48,14 +48,6 @@
       // TODO: Make sure this works with custom versions as well!
       DataVersion newVersion = ((DefaultDataVersion) node.getVersion()).increment();
       node.setVersion(newVersion);
-
-      // if the parent is in the context make sure the parent has a ref to the copy now.
-      Fqn parentFqn = getFqn().getParent();
-      if (!getFqn().isRoot() && (lockParent || container.peek(parentFqn) == null))
-      {
-         NodeSPI parent = ctx.lookUpNode(parentFqn);
-         if (parent != null) parent.addChildDirect(nodeFactory.createNodeInvocationDelegate(node));
-      }
    }
 
    @Override

Modified: core/trunk/src/test/java/org/jboss/cache/api/mvcc/LockTestBase.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/api/mvcc/LockTestBase.java	2008-07-02 13:39:16 UTC (rev 6153)
+++ core/trunk/src/test/java/org/jboss/cache/api/mvcc/LockTestBase.java	2008-07-02 17:34:40 UTC (rev 6154)
@@ -41,7 +41,6 @@
    protected Fqn ABCD = Fqn.fromString("/a/b/c/d");
    protected LockManager lockManager;
    protected InvocationContextContainer icc;
-   protected boolean lockParentForInsertRemove = false;
    protected boolean repeatableRead = true;
    protected boolean allowWriteSkew = false;
 
@@ -51,7 +50,6 @@
       cache = new DefaultCacheFactory<String, String>().createCache(UnitTestCacheConfigurationFactory.createConfiguration(CacheMode.LOCAL), false);
       cache.getConfiguration().setNodeLockingScheme(NodeLockingScheme.MVCC);
       cache.getConfiguration().setTransactionManagerLookupClass(DummyTransactionManagerLookup.class.getName());
-      cache.getConfiguration().setLockParentForChildInsertRemove(lockParentForInsertRemove);
       cache.getConfiguration().setIsolationLevel(repeatableRead ? IsolationLevel.REPEATABLE_READ : IsolationLevel.READ_COMMITTED);
       cache.getConfiguration().setAllowWriteSkew(allowWriteSkew);
       // reduce lock acquisition timeout so this doesn't take forever to run
@@ -92,10 +90,7 @@
    {
       tm.begin();
       cache.put(AB, "k", "v");
-      if (lockParentForInsertRemove)
-         assertLocked(Fqn.ROOT);
-      else
-         assertNotLocked(Fqn.ROOT);
+      assertLocked(Fqn.ROOT);
       assertLocked(A);
       assertLocked(AB);
       assertNotLocked(ABC);
@@ -117,10 +112,7 @@
       cache.put(ABC, "k", "v");
       assertNotLocked(Fqn.ROOT);
       assertNotLocked(A);
-      if (lockParentForInsertRemove)
-         assertLocked(AB);
-      else
-         assertNotLocked(AB);
+      assertLocked(AB);
       assertLocked(ABC);
       tm.commit();
 
@@ -131,10 +123,7 @@
    {
       tm.begin();
       cache.put(AB, Collections.singletonMap("k", "v"));
-      if (lockParentForInsertRemove)
-         assertLocked(Fqn.ROOT);
-      else
-         assertNotLocked(Fqn.ROOT);
+      assertLocked(Fqn.ROOT);
       assertLocked(A);
       assertLocked(AB);
       assertNotLocked(ABC);
@@ -157,10 +146,7 @@
       cache.put(ABC, Collections.singletonMap("k", "v"));
       assertNotLocked(Fqn.ROOT);
       assertNotLocked(A);
-      if (lockParentForInsertRemove)
-         assertLocked(AB);
-      else
-         assertNotLocked(AB);
+      assertLocked(AB);
       assertLocked(ABC);
       tm.commit();
 
@@ -177,10 +163,7 @@
       tm.begin();
       cache.removeNode(AB);
       assertLocked(AB);
-      if (lockParentForInsertRemove)
-         assertLocked(A);
-      else
-         assertNotLocked(A);
+      assertLocked(A);
       assertNotLocked(Fqn.ROOT);
       tm.commit();
       assert cache.getNode(AB) == null : "Should not exist";
@@ -197,10 +180,7 @@
       tm.begin();
       cache.evict(AB);
       assertLocked(AB);
-      if (lockParentForInsertRemove)
-         assertLocked(A);
-      else
-         assertNotLocked(A);
+      assertLocked(A);
       assertNotLocked(Fqn.ROOT);
       tm.commit();
       assert cache.getNode(AB) == null : "Should not exist";
@@ -223,10 +203,7 @@
       assertLocked(AB);
       assertLocked(ABC);
       assertLocked(ABCD);
-      if (lockParentForInsertRemove)
-         assertLocked(A);
-      else
-         assertNotLocked(A);
+      assertLocked(A);
       assertNotLocked(Fqn.ROOT);
       tm.commit();
       assert cache.getNode(AB) == null : "Should not exist";
@@ -240,10 +217,7 @@
       tm.begin();
       cache.removeNode(AB);
       assertLocked(AB);
-      if (lockParentForInsertRemove)
-         assertLocked(A);
-      else
-         assertNotLocked(A);
+      assertLocked(A);
       assertNotLocked(Fqn.ROOT);
       tm.commit();
       assert cache.getNode(AB) == null : "Should not exist";
@@ -257,10 +231,7 @@
       tm.begin();
       cache.evict(AB);
       assertLocked(AB);
-      if (lockParentForInsertRemove)
-         assertLocked(A);
-      else
-         assertNotLocked(A);
+      assertLocked(A);
       assertNotLocked(Fqn.ROOT);
       tm.commit();
       assert cache.getNode(AB) == null : "Should not exist";

Modified: core/trunk/src/test/java/org/jboss/cache/api/mvcc/read_committed/ReadCommittedLockTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/api/mvcc/read_committed/ReadCommittedLockTest.java	2008-07-02 13:39:16 UTC (rev 6153)
+++ core/trunk/src/test/java/org/jboss/cache/api/mvcc/read_committed/ReadCommittedLockTest.java	2008-07-02 17:34:40 UTC (rev 6154)
@@ -9,6 +9,5 @@
    public ReadCommittedLockTest()
    {
       repeatableRead = false;
-      lockParentForInsertRemove = false;
    }
 }

Deleted: core/trunk/src/test/java/org/jboss/cache/api/mvcc/read_committed/ReadCommittedWithParentLockTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/api/mvcc/read_committed/ReadCommittedWithParentLockTest.java	2008-07-02 13:39:16 UTC (rev 6153)
+++ core/trunk/src/test/java/org/jboss/cache/api/mvcc/read_committed/ReadCommittedWithParentLockTest.java	2008-07-02 17:34:40 UTC (rev 6154)
@@ -1,14 +0,0 @@
-package org.jboss.cache.api.mvcc.read_committed;
-
-import org.jboss.cache.api.mvcc.LockTestBase;
-import org.testng.annotations.Test;
-
- at Test(groups = {"functional", "mvcc"})
-public class ReadCommittedWithParentLockTest extends LockTestBase
-{
-   public ReadCommittedWithParentLockTest()
-   {
-      repeatableRead = false;
-      lockParentForInsertRemove = true;
-   }
-}

Modified: core/trunk/src/test/java/org/jboss/cache/api/mvcc/repeatable_read/NodeAPIMVCCTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/api/mvcc/repeatable_read/NodeAPIMVCCTest.java	2008-07-02 13:39:16 UTC (rev 6153)
+++ core/trunk/src/test/java/org/jboss/cache/api/mvcc/repeatable_read/NodeAPIMVCCTest.java	2008-07-02 17:34:40 UTC (rev 6154)
@@ -25,6 +25,7 @@
    protected void configure(Configuration c)
    {
       c.setIsolationLevel(IsolationLevel.REPEATABLE_READ);
+      c.setLockParentForChildInsertRemove(true);
    }
 
    protected void assertNodeLockingScheme()

Modified: core/trunk/src/test/java/org/jboss/cache/api/mvcc/repeatable_read/RepeatableReadNoWriteSkewLockTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/api/mvcc/repeatable_read/RepeatableReadNoWriteSkewLockTest.java	2008-07-02 13:39:16 UTC (rev 6153)
+++ core/trunk/src/test/java/org/jboss/cache/api/mvcc/repeatable_read/RepeatableReadNoWriteSkewLockTest.java	2008-07-02 17:34:40 UTC (rev 6154)
@@ -8,6 +8,5 @@
    public RepeatableReadNoWriteSkewLockTest()
    {
       allowWriteSkew = false;
-      lockParentForInsertRemove = false;
    }
 }

Deleted: core/trunk/src/test/java/org/jboss/cache/api/mvcc/repeatable_read/RepeatableReadNoWriteSkewWithParentLockTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/api/mvcc/repeatable_read/RepeatableReadNoWriteSkewWithParentLockTest.java	2008-07-02 13:39:16 UTC (rev 6153)
+++ core/trunk/src/test/java/org/jboss/cache/api/mvcc/repeatable_read/RepeatableReadNoWriteSkewWithParentLockTest.java	2008-07-02 17:34:40 UTC (rev 6154)
@@ -1,13 +0,0 @@
-package org.jboss.cache.api.mvcc.repeatable_read;
-
-import org.testng.annotations.Test;
-
- at Test(groups = {"functional", "mvcc"})
-public class RepeatableReadNoWriteSkewWithParentLockTest extends RepeatableReadTestBase
-{
-   public RepeatableReadNoWriteSkewWithParentLockTest()
-   {
-      allowWriteSkew = false;
-      lockParentForInsertRemove = true;
-   }
-}

Modified: core/trunk/src/test/java/org/jboss/cache/api/mvcc/repeatable_read/RepeatableReadWriteSkewLockTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/api/mvcc/repeatable_read/RepeatableReadWriteSkewLockTest.java	2008-07-02 13:39:16 UTC (rev 6153)
+++ core/trunk/src/test/java/org/jboss/cache/api/mvcc/repeatable_read/RepeatableReadWriteSkewLockTest.java	2008-07-02 17:34:40 UTC (rev 6154)
@@ -8,6 +8,5 @@
    public RepeatableReadWriteSkewLockTest()
    {
       allowWriteSkew = true;
-      lockParentForInsertRemove = false;
    }
 }

Deleted: core/trunk/src/test/java/org/jboss/cache/api/mvcc/repeatable_read/RepeatableReadWriteSkewWithParentLockTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/api/mvcc/repeatable_read/RepeatableReadWriteSkewWithParentLockTest.java	2008-07-02 13:39:16 UTC (rev 6153)
+++ core/trunk/src/test/java/org/jboss/cache/api/mvcc/repeatable_read/RepeatableReadWriteSkewWithParentLockTest.java	2008-07-02 17:34:40 UTC (rev 6154)
@@ -1,13 +0,0 @@
-package org.jboss.cache.api.mvcc.repeatable_read;
-
-import org.testng.annotations.Test;
-
- at Test(groups = {"functional", "mvcc"})
-public class RepeatableReadWriteSkewWithParentLockTest extends RepeatableReadTestBase
-{
-   public RepeatableReadWriteSkewWithParentLockTest()
-   {
-      allowWriteSkew = true;
-      lockParentForInsertRemove = true;
-   }
-}




More information about the jbosscache-commits mailing list