Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO] Should a CDORevision already have changes of RevisionDelta applied?
[CDO] Should a CDORevision already have changes of RevisionDelta applied? [message #1857849] Wed, 01 March 2023 14:29 Go to next message
Linuxhippy Mising name is currently offline Linuxhippy Mising nameFriend
Messages: 71
Registered: July 2009
Member
Hello,

Should a CDORevision already have the changes listed in its revision delta applied to it?
The reason I ask is I am currently debugging a diff-viewer table, which works as expected but in some corner-cases fails to show the correct values of the attributes of a revision.

It basically does (siplified) the following steps:

Revision revision = (Revision) cell.getElement(); // get revision of current row of the table
CDORevisionKey cdoRevisionKey = revision.getRevisionKey();
((CDORevisionDelta) cdoRevisionKey).getFeatureDeltas(); // search through all deltas


searching through the feature-deltas (by comparing the changed feature) finds a changed attribute named gwSubstanceGroup , which is a list which was previously empty and now has a single element ("CKW") added to it:

CDOFeatureDelta[gwSubstanceGroup, LIST, originSize=0, list=[CDOFeatureDelta[gwSubstanceGroup, ADD, value=CKW, index=0]]]


However, when I try to load the value that attribute had in this revision, I simply get null:
Object value = ((InternalCDORevision) revision).getValue(iemfProperty);

whereas iemfProperty is exactly the feature which matched the delta before:

org.eclipse.emf.ecore.impl.EAttributeImpl@4aae8619 (name: gwSubstanceGroup) (ordered: true, unique: true, lowerBound: 0, upperBound: -1) (changeable: true, volatile: false, transient: false, defaultValueLiteral: null, unsettable: false, derived: false) (iD: false)

Digging a bit into getValue the offset is calculated and really, the position in the Object[] just contains null. To me it seems the revision contains the attribute-values without the changes (delta) applied to it.
I came to this conclusion, because the next (newer) revision contains the modifications listed in the current feature delta. So e.g. revision 1 contains the delta but not the actual modifications, revision 2 does in contrast not contain the delta information but the values are set there...

Any ideas about what is happening here would be greatly appreciated.

Best regards, Clemens

PS: We are using CDO 4.9 unfortunatly

[Updated on: Wed, 01 March 2023 15:47]

Report message to a moderator

Re: [CDO] Should a CDORevision already have changes of RevisionDelta applied? [message #1857909 is a reply to message #1857849] Mon, 06 March 2023 08:26 Go to previous message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Hi Clemens,

Sorry, your question confuses me:

Linuxhippy Mising name wrote on Wed, 01 March 2023 15:29
Should a CDORevision already have the changes listed in its revision delta applied to it?


What do you mean be "its revision deltas"? A CDORevision has no reference to revision deltas. They can be applied, though, but then the question is where and when does that happen?

Then, in your code snippet, the "Revision" is most likely not a CDO revision, as that would not carry deltas along.


Previous Topic:Location of Containment Proxy Objects
Next Topic:API-level facility for dynamic models
Goto Forum:
  


Current Time: Fri Apr 26 20:52:17 GMT 2024

Powered by FUDForum. Page generated in 0.03046 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top