jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sch...@apache.org
Subject svn commit: r1327436 - in /jackrabbit/branches/2.4: ./ jackrabbit-core/src/main/java/org/apache/jackrabbit/core/ItemSaveOperation.java jackrabbit-core/src/test/java/org/apache/jackrabbit/core/MoveRemoveTest.java
Date Wed, 18 Apr 2012 10:01:14 GMT
Author: schans
Date: Wed Apr 18 10:01:14 2012
New Revision: 1327436

URL: http://svn.apache.org/viewvc?rev=1327436&view=rev
Log:
JCR-3289: Fix data inconsistency when remove operation is performed after move operation (merge
from trunk)

Added:
    jackrabbit/branches/2.4/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/MoveRemoveTest.java
      - copied unchanged from r1311861, jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/MoveRemoveTest.java
Modified:
    jackrabbit/branches/2.4/   (props changed)
    jackrabbit/branches/2.4/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/ItemSaveOperation.java

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

Modified: jackrabbit/branches/2.4/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/ItemSaveOperation.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.4/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/ItemSaveOperation.java?rev=1327436&r1=1327435&r2=1327436&view=diff
==============================================================================
--- jackrabbit/branches/2.4/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/ItemSaveOperation.java
(original)
+++ jackrabbit/branches/2.4/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/ItemSaveOperation.java
Wed Apr 18 10:01:14 2012
@@ -712,13 +712,16 @@ class ItemSaveOperation implements Sessi
      * definitively remove each one
      */
     private void removeTransientItems(
-            SessionItemStateManager sism, Iterable<ItemState> states) {
+            SessionItemStateManager sism, Iterable<ItemState> states) throws StaleItemStateException
{
         for (ItemState transientState : states) {
             ItemState persistentState = transientState.getOverlayedState();
             // remove persistent state
             // this will indirectly (through stateDestroyed listener method)
             // permanently invalidate all Item instances wrapping it
             assert persistentState != null;
+            if (transientState.getModCount() != persistentState.getModCount()) {
+                throw new StaleItemStateException(transientState.getId() + " has been modified
externally");
+            }
             sism.destroy(persistentState);
         }
     }



Mime
View raw message