Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 315409

Summary: Missing Revsion Version Increment
Product: [Modeling] EMF Reporter: Michael Szediwy <michael>
Component: cdo.coreAssignee: Eike Stepper <stepper>
Status: CLOSED FIXED QA Contact: Eike Stepper <stepper>
Severity: major    
Priority: P3 CC: saulius.tvarijonas
Version: 3.0   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
Patch v1 - for future reference none

Description Michael Szediwy CLA 2010-06-02 11:11:04 EDT
Build Identifier: 3.0

It seems that recently an optimization has been introduced to directly create new revisions on an InvalidateTransition if the delta is available. It looks like the version increment is missing.

As a test I tried to increment the version by 1 within the InvalidateTransition:

CDORevisionDelta delta = (CDORevisionDelta)key;
InternalCDORevision newRevision = oldRevision.copy();
>>>> newRevision.setVersion(oldRevision.getVersion() + 1);
delta.apply(newRevision);

As I am the only one comitting to my repository all the "Modifying old revision" exceptions are gone.

Maybe it would be a good solution to undo the recently introduced optimization... 

Reproducible: Always
Comment 1 Eike Stepper CLA 2010-06-02 15:14:27 EDT
I'll have to write tests first. I suspect that the created timestamp might also be wrong in these cases...
Comment 2 Eike Stepper CLA 2010-06-03 04:35:20 EDT
Added tests:

org.eclipse.emf.cdo.tests.ChangeSubscriptionTest.testInvalidationWithDeltas_SameBranch()
org.eclipse.emf.cdo.tests.ChangeSubscriptionTest.testInvalidationWithDeltas_SubBranch()

Problem fixed, all tests pass.

Committed to HEAD.
Comment 3 Eike Stepper CLA 2010-06-03 04:36:55 EDT
Created attachment 170922 [details]
Patch v1 - for future reference
Comment 4 Eike Stepper CLA 2010-06-29 04:35:52 EDT
Available in 3.0 GA:
http://download.eclipse.org/modeling/emf/cdo/updates/3.0-releases/