aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2018-06-01 00:40:44 -0400
committerEike Stepper2018-06-01 00:58:27 -0400
commit50b170cc24c35043465d9251ef0ab996c639b142 (patch)
treecf7509d6d5ec76a5323fd6061a4d893538e6e0bb
parentc9aef005fe4a018d598da0bf7f2db38bf481e309 (diff)
downloadcdo-50b170cc24c35043465d9251ef0ab996c639b142.tar.gz
cdo-50b170cc24c35043465d9251ef0ab996c639b142.tar.xz
cdo-50b170cc24c35043465d9251ef0ab996c639b142.zip
[535395] "Unique index or primary key violation" with CDOMergingConflictResolver and a case of a CDORevisionDelta with an empty featureDeltas
https://bugs.eclipse.org/bugs/show_bug.cgi?id=535395
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ConflictResolverTest.java37
1 files changed, 37 insertions, 0 deletions
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ConflictResolverTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ConflictResolverTest.java
index 30969af852..78baeb647c 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ConflictResolverTest.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ConflictResolverTest.java
@@ -11,6 +11,7 @@
*/
package org.eclipse.emf.cdo.tests;
+import org.eclipse.emf.cdo.eresource.CDOResource;
import org.eclipse.emf.cdo.session.CDOSession;
import org.eclipse.emf.cdo.tests.config.IModelConfig;
import org.eclipse.emf.cdo.tests.model1.Address;
@@ -182,6 +183,42 @@ public class ConflictResolverTest extends AbstractCDOTest
commitAndSync(transaction1, transaction2);
}
+ public void testMergeLocalChangesPerFeature_Bug3() throws Exception
+ {
+ CDOSession session = openSession();
+
+ CDOTransaction transaction1 = session.openTransaction();
+ transaction1.options().addConflictResolver(createConflictResolver());
+ CDOResource resource1 = transaction1.getOrCreateResource(getResourcePath("/res1"));
+ EList<EObject> contents1 = resource1.getContents();
+ // transaction1.commit();
+ contents1.add(getModel1Factory().createAddress());
+ contents1.add(getModel1Factory().createAddress());
+
+ // ----------------------------
+
+ CDOTransaction transaction2 = session.openTransaction();
+ transaction2.options().addConflictResolver(createConflictResolver());
+ CDOResource resource2 = transaction2.getOrCreateResource(getResourcePath("/res1"));
+ EList<EObject> contents2 = resource2.getContents();
+ contents2.add(getModel1Factory().createAddress());
+ contents2.remove(0);
+
+ // ----------------------------
+
+ CDOTransaction transaction3 = session.openTransaction();
+ transaction3.options().addConflictResolver(createConflictResolver());
+ CDOResource resource3 = transaction3.getOrCreateResource(getResourcePath("/res1"));
+ EList<EObject> contents3 = resource3.getContents();
+ contents3.add(getModel1Factory().createAddress());
+ contents3.add(getModel1Factory().createAddress());
+
+ // Resolvers should be triggered.
+ commitAndSync(transaction3, transaction2, transaction1);
+ commitAndSync(transaction2, transaction1, transaction3);
+ commitAndSync(transaction1, transaction2, transaction3);
+ }
+
public void testMerge_ManyValue() throws Exception
{
CDOSession session = openSession();