jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sch...@apache.org
Subject svn commit: r1327442 - in /jackrabbit/branches/2.4: ./ jackrabbit-core/src/main/java/org/apache/jackrabbit/core/ jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ jackrabbit-core/src/test/java/org/apache/jackrabbit/core/integration/daily/
Date Wed, 18 Apr 2012 10:22:00 GMT
Author: schans
Date: Wed Apr 18 10:22:00 2012
New Revision: 1327442

URL: http://svn.apache.org/viewvc?rev=1327442&view=rev
Log:
JCR-3292: Prevent workspace.move() from causing data inconsistencies (merged from trunk)

Added:
    jackrabbit/branches/2.4/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ConcurrentAddMoveRemoveTest.java
      - copied unchanged from r1327180, jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ConcurrentAddMoveRemoveTest.java
Modified:
    jackrabbit/branches/2.4/   (props changed)
    jackrabbit/branches/2.4/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/BatchedItemOperations.java
    jackrabbit/branches/2.4/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/integration/daily/DailyIntegrationTest.java

Propchange: jackrabbit/branches/2.4/
------------------------------------------------------------------------------
  Merged /jackrabbit/trunk:r1327180

Modified: jackrabbit/branches/2.4/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/BatchedItemOperations.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.4/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/BatchedItemOperations.java?rev=1327442&r1=1327441&r2=1327442&view=diff
==============================================================================
--- jackrabbit/branches/2.4/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/BatchedItemOperations.java
(original)
+++ jackrabbit/branches/2.4/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/BatchedItemOperations.java
Wed Apr 18 10:22:00 2012
@@ -547,7 +547,9 @@ public class BatchedItemOperations exten
             srcNameIndex = 1;
         }
 
+        stateMgr.store(target);
         if (renameOnly) {
+            stateMgr.store(srcParent);
             // change child node entry
             destParent.renameChildNodeEntry(srcPath.getName(), srcNameIndex,
                     destPath.getName());
@@ -561,6 +563,9 @@ public class BatchedItemOperations exten
                 throw new UnsupportedRepositoryOperationException(msg);
             }
 
+            stateMgr.store(srcParent);
+            stateMgr.store(destParent);
+
             // do move:
             // 1. remove child node entry from old parent
             if (srcParent.removeChildNodeEntry(target.getNodeId())) {
@@ -571,14 +576,6 @@ public class BatchedItemOperations exten
             }
         }
 
-        // store states
-        stateMgr.store(target);
-        if (renameOnly) {
-            stateMgr.store(srcParent);
-        } else {
-            stateMgr.store(destParent);
-            stateMgr.store(srcParent);
-        }
         return target.getNodeId();
     }
 

Modified: jackrabbit/branches/2.4/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/integration/daily/DailyIntegrationTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.4/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/integration/daily/DailyIntegrationTest.java?rev=1327442&r1=1327441&r2=1327442&view=diff
==============================================================================
--- jackrabbit/branches/2.4/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/integration/daily/DailyIntegrationTest.java
(original)
+++ jackrabbit/branches/2.4/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/integration/daily/DailyIntegrationTest.java
Wed Apr 18 10:22:00 2012
@@ -20,6 +20,7 @@ import junit.framework.Test;
 import junit.framework.TestCase;
 import junit.framework.TestSuite;
 import org.apache.jackrabbit.core.ConcurrencyTest;
+import org.apache.jackrabbit.core.ConcurrentAddMoveRemoveTest;
 import org.apache.jackrabbit.core.ConcurrentCheckinMixedTransactionTest;
 import org.apache.jackrabbit.core.ConcurrentLoginTest;
 import org.apache.jackrabbit.core.ConcurrentNodeModificationTest;
@@ -54,6 +55,7 @@ public class DailyIntegrationTest extend
         suite.addTestSuite(ConcurrentVersioningTest.class);
         suite.addTestSuite(ConcurrentVersioningWithTransactionsTest.class);
         suite.addTestSuite(ConcurrentCheckinMixedTransactionTest.class);
+        suite.addTestSuite(ConcurrentAddMoveRemoveTest.class);
         suite.addTestSuite(LockTest.class);
         suite.addTestSuite(ReadVersionsWhileModified.class);
         suite.addTestSuite(ConcurrentLockingTest.class);



Mime
View raw message