Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 315409 - Missing Revsion Version Increment
Summary: Missing Revsion Version Increment
Status: CLOSED FIXED
Alias: None
Product: EMF
Classification: Modeling
Component: cdo.core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows 7
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Eike Stepper CLA
QA Contact: Eike Stepper CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-02 11:11 EDT by Michael Szediwy CLA
Modified: 2010-06-29 09:21 EDT (History)
1 user (show)

See Also:


Attachments
Patch v1 - for future reference (14.45 KB, patch)
2010-06-03 04:36 EDT, Eike Stepper CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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/