Index: src/main/java/org/apache/jackrabbit/core/state/NodeStateMerger.java
===================================================================
--- src/main/java/org/apache/jackrabbit/core/state/NodeStateMerger.java	(revision 782898)
+++ src/main/java/org/apache/jackrabbit/core/state/NodeStateMerger.java	(working copy)
@@ -131,6 +131,10 @@
                         if (context.isDeleted(cne.getId())) {
                             // a child node entry has been removed from this node state
                             removed.add(cne);
+                        } else {
+                            // We can't distinguish externally added child nodes from locally
+                            // moved child nodes; see JCR-2129
+                            return false;
                         }
                     }
 
Index: src/test/java/org/apache/jackrabbit/core/ConcurrentAddMoveTest.java
===================================================================
--- src/test/java/org/apache/jackrabbit/core/ConcurrentAddMoveTest.java	(revision 0)
+++ src/test/java/org/apache/jackrabbit/core/ConcurrentAddMoveTest.java	(revision 0)
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.core;
+
+import javax.jcr.InvalidItemStateException;
+import javax.jcr.Node;
+import javax.jcr.Session;
+
+import org.apache.jackrabbit.test.AbstractJCRTest;
+
+public final class ConcurrentAddMoveTest extends AbstractJCRTest {
+
+    /**
+     * {@inheritDoc}
+     */
+    public void setUp() throws Exception {
+        super.setUp();
+        Node a = testRootNode.addNode("A");
+        Node b = a.addNode("B");
+        testRootNode.addNode("C");
+        testRootNode.getSession().save();
+    }
+
+    /**
+     * @throws Exception on test error
+     */
+    public void testConcurrentAddMove() throws Exception {
+        testRootNode.getNode("A").addNode("D");
+        Session session = helper.getSuperuserSession();
+        session.move(testRoot + "/A/B", testRoot + "/C/B");
+
+        testRootNode.getSession().save();
+
+        boolean ex = false;
+        try {
+            session.save();
+        } catch (InvalidItemStateException e) {
+            ex = true;
+        }
+        session.logout();
+        assertTrue("expected exception", ex);
+    }
+}

Property changes on: src\test\java\org\apache\jackrabbit\core\ConcurrentAddMoveTest.java
___________________________________________________________________
Name: svn:keywords
   + LastChangedBy LastChangedDate LastChangedRevision HeadURL
Name: svn:eol-style
   + native

