Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO] CDORevisionData.NIL in revision deltas - not supported?
[CDO] CDORevisionData.NIL in revision deltas - not supported? [message #1036840] Mon, 08 April 2013 18:15 Go to next message
Christian W. Damus is currently offline Christian W. Damus
Messages: 768
Registered: July 2009
Senior Member
Hi, Eike,

In investigation of problems in handling explicit null values of
unsettable attributes, it appears to me that CDORevisionData.NIL cannot
be transmitted to the server as the new value in a
CDOSingleValueFeatureDeltaImpl.

Running the test case contributed in this attachment:

https://bugs.eclipse.org/bugs/attachment.cgi?id=229404

on this bug:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=404152

also used by this follow-up bug:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=405191

I see that the reason why the test fails is that the revision delta
created as a result of the CDOLegacyAdapter::notifySet(...) method
pushing the "new value" of an unsettable feature into the CDOStore has
a Java null as the new value instead of CDORevisionData.NIL.

When the revision for a new object has a CDORevisionData.NIL value for
some attribute, there is no problem sending it to the server. Another
client reading this revision from the server gets the NIL value and
correctly translates it to an explicit null (is-set) value of the
unsettable feature.

But for objects that already exist, the client sends revision deltas
(containing feature deltas) to the server. In an attempt to fix
405191, I changed the legacy adapter to ensure that the new-value in
the feature delta is CDORevisionData.NIL when an unsettable feature is
changed to an explicit (is-set) null value. This results in a
ClassCastException (see trace, below) when writing the feature delta to
a CDODataOutputImpl delegates the the CDOTypeImpl.STRING to write the
value, but this tries to cast the NIL to a String.

Note that the same ClassCastException occurs when trying run the test
case from the above-linked attachment in a native (not legacy) test
configuration. It would seem that native models don't support
unsettable attributes of EString type at all.

So, the bottom line is: are unsettable attributes supposed to be
supported by CDO in attributes of EString type (and BooleanObject,
IntegerObject, FloatObject, etc.)? If so, I don't know how I can
safely update the communication protocol for revision deltas on the
client and server ends to support whatever backward/forward
compatibility of the protocol might be required.

I've pushed the test case (with changes to model6) to the bugs/405191
branch in Git, so it should be easy to check it out and run to see what
I mean.

Thanks,

Christian
Re: [CDO] CDORevisionData.NIL in revision deltas - not supported? [message #1037187 is a reply to message #1036840] Tue, 09 April 2013 05:02 Go to previous message
Eike Stepper is currently offline Eike Stepper
Messages: 5499
Registered: July 2009
Senior Member
Comments are on https://bugs.eclipse.org/bugs/show_bug.cgi?id=405191 ...

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
Previous Topic:Loading an encrypted emf resource
Next Topic:removing dyn. contributed items from a menu.
Goto Forum:
  


Current Time: Wed Aug 20 14:39:59 EDT 2014

Powered by FUDForum. Page generated in 0.01941 seconds