Community
Participate
Working Groups
Build Identifier: 4.0 Commit will throw a CommitException for new objects which have been merged from another branch when XRef-check is enabled, because the objects are not excluded from the lockTargets list: Caused by: java.lang.IllegalStateException: Object OID4 can not be referenced anymore because it has been detached at org.eclipse.emf.cdo.internal.server.TransactionCommitContext.lockObjects(TransactionCommitContext.java:662) at org.eclipse.emf.cdo.internal.server.TransactionCommitContext.write(TransactionCommitContext.java:318) at org.eclipse.emf.cdo.spi.server.InternalCommitContext$1.runLoop(InternalCommitContext.java:39) at org.eclipse.emf.cdo.spi.server.InternalCommitContext$1.runLoop(InternalCommitContext.java:1) at org.eclipse.net4j.util.om.monitor.ProgressDistributor.run(ProgressDistributor.java:96) Reproducible: Always Steps to Reproduce: 1. setup environment with XRef checking and 2 branches. 2. create a new (single or many value) containment object and add it to one branch. 3. merge it to the other branch, then commit.
Created attachment 177831 [details] Testcase
Created attachment 177832 [details] Proposed patch I added a check of the newObjects list before adding the object to the lockTargets.
1) The number of lines that you changed is smaller than 250. confirmed. 2) You are the only author of these changed lines. confirmed. 3) You apply the EPL to these changed lines. confirmed.
Good catch! I've only changed it slightly in that the new check is done against a Set<CDOID> that is precalculated in lockObject(): if (ensuringReferentialIntegrity) { final Set<CDOID> newIDs = new HashSet<CDOID>(); for (int i = 0; i < newObjects.length; i++) { InternalCDORevision newRevision = newObjects[i]; CDOID newID = newRevision.getID(); if (newID instanceof CDOIDObject) { // After merges newObjects may contain non-TEMP ids newIDs.add(newID); } }
Committed to HEAD
Available in R20110608-1407