Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO] CDOFeatureDelta => ADD with null
[CDO] CDOFeatureDelta => ADD with null [message #529631] Mon, 26 April 2010 15:12 Go to next message
Cyril Jaquier is currently offline Cyril JaquierFriend
Messages: 80
Registered: July 2009
Member
Hi all,

In a test case I have the following code:

data1.getHeartbeatMap().put("AAR1", heartbeat);
data1.getHeartbeatMap().remove("AAR1");
commit();

CDO generates the following feature deltas:

[CDORevisionDelta[ScenarioData@OID298:0v1 -->
[CDOFeatureDelta[heartbeatMap, LIST, list=[CDOFeatureDelta[heartbeatMap,
ADD, value=NULL, index=0], CDOFeatureDelta[heartbeatMap, REMOVE,
value=UNKNOWN, index=0]]]]]]

Notice the "value=NULL" for the ADD. Is this a bug in CDO or the
expected behaviour? I think (I've not tested) that in this case, 2
notifications whould be generated, one ADD with null and one REMOVE. I
would have expected either ADD with a value (e.g. heartbeat in this
case) or no notification at all.

Moreover, when doing this:

data1.getHeartbeatMap().put("AAR1", heartbeat);
data1.getHeartbeatMap().remove("AAR1");
data1.getHeartbeatMap().put("AAR1", heartbeat);
data1.getHeartbeatMap().remove("AAR1");
data1.getHeartbeatMap().put("AAR1", heartbeat);
data1.getHeartbeatMap().remove("AAR1");
data1.getHeartbeatMap().put("AAR1", heartbeat);
data1.getHeartbeatMap().remove("AAR1");
data1.getHeartbeatMap().put("AAR1", heartbeat);
data1.getHeartbeatMap().remove("AAR1");
data1.getHeartbeatMap().put("AAR1", heartbeat);
data1.getHeartbeatMap().remove("AAR1");
commit();

CDO generates the following feature deltas:

[CDORevisionDelta[ScenarioData@OID1586:0v1 -->
[CDOFeatureDelta[heartbeatMap, LIST, list=[CDOFeatureDelta[heartbeatMap,
ADD, value=NULL, index=0], CDOFeatureDelta[heartbeatMap, REMOVE,
value=UNKNOWN, index=0], CDOFeatureDelta[heartbeatMap, ADD, value=NULL,
index=0], CDOFeatureDelta[heartbeatMap, REMOVE, value=UNKNOWN, index=0],
CDOFeatureDelta[heartbeatMap, ADD, value=NULL, index=0],
CDOFeatureDelta[heartbeatMap, REMOVE, value=UNKNOWN, index=0],
CDOFeatureDelta[heartbeatMap, ADD, value=NULL, index=0],
CDOFeatureDelta[heartbeatMap, REMOVE, value=UNKNOWN, index=0],
CDOFeatureDelta[heartbeatMap, ADD, value=NULL, index=0],
CDOFeatureDelta[heartbeatMap, REMOVE, value=UNKNOWN, index=0],
CDOFeatureDelta[heartbeatMap, ADD, value=NULL, index=0],
CDOFeatureDelta[heartbeatMap, REMOVE, value=UNKNOWN, index=0]]]]]]

Can't CDO optimize this? How is this handled at the database level?

Thank you.

Cheers,
Cyril
Re: [CDO] CDOFeatureDelta => ADD with null [message #529680 is a reply to message #529631] Mon, 26 April 2010 17:56 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Hi Cyril,

This is certainly not good. No harm is done to the database though. If
you file a bugzilla we can look into optimizing this. Thanks for
pointing this out.

Cheers
/Eike

----
http://thegordian.blogspot.com
http://twitter.com/eikestepper



Am 26.04.2010 17:12, schrieb Cyril Jaquier:
> Hi all,
>
> In a test case I have the following code:
>
> data1.getHeartbeatMap().put("AAR1", heartbeat);
> data1.getHeartbeatMap().remove("AAR1");
> commit();
>
> CDO generates the following feature deltas:
>
> [CDORevisionDelta[ScenarioData@OID298:0v1 -->
> [CDOFeatureDelta[heartbeatMap, LIST,
> list=[CDOFeatureDelta[heartbeatMap, ADD, value=NULL, index=0],
> CDOFeatureDelta[heartbeatMap, REMOVE, value=UNKNOWN, index=0]]]]]]
>
> Notice the "value=NULL" for the ADD. Is this a bug in CDO or the
> expected behaviour? I think (I've not tested) that in this case, 2
> notifications whould be generated, one ADD with null and one REMOVE. I
> would have expected either ADD with a value (e.g. heartbeat in this
> case) or no notification at all.
>
> Moreover, when doing this:
>
> data1.getHeartbeatMap().put("AAR1", heartbeat);
> data1.getHeartbeatMap().remove("AAR1");
> data1.getHeartbeatMap().put("AAR1", heartbeat);
> data1.getHeartbeatMap().remove("AAR1");
> data1.getHeartbeatMap().put("AAR1", heartbeat);
> data1.getHeartbeatMap().remove("AAR1");
> data1.getHeartbeatMap().put("AAR1", heartbeat);
> data1.getHeartbeatMap().remove("AAR1");
> data1.getHeartbeatMap().put("AAR1", heartbeat);
> data1.getHeartbeatMap().remove("AAR1");
> data1.getHeartbeatMap().put("AAR1", heartbeat);
> data1.getHeartbeatMap().remove("AAR1");
> commit();
>
> CDO generates the following feature deltas:
>
> [CDORevisionDelta[ScenarioData@OID1586:0v1 -->
> [CDOFeatureDelta[heartbeatMap, LIST,
> list=[CDOFeatureDelta[heartbeatMap, ADD, value=NULL, index=0],
> CDOFeatureDelta[heartbeatMap, REMOVE, value=UNKNOWN, index=0],
> CDOFeatureDelta[heartbeatMap, ADD, value=NULL, index=0],
> CDOFeatureDelta[heartbeatMap, REMOVE, value=UNKNOWN, index=0],
> CDOFeatureDelta[heartbeatMap, ADD, value=NULL, index=0],
> CDOFeatureDelta[heartbeatMap, REMOVE, value=UNKNOWN, index=0],
> CDOFeatureDelta[heartbeatMap, ADD, value=NULL, index=0],
> CDOFeatureDelta[heartbeatMap, REMOVE, value=UNKNOWN, index=0],
> CDOFeatureDelta[heartbeatMap, ADD, value=NULL, index=0],
> CDOFeatureDelta[heartbeatMap, REMOVE, value=UNKNOWN, index=0],
> CDOFeatureDelta[heartbeatMap, ADD, value=NULL, index=0],
> CDOFeatureDelta[heartbeatMap, REMOVE, value=UNKNOWN, index=0]]]]]]
>
> Can't CDO optimize this? How is this handled at the database level?
>
> Thank you.
>
> Cheers,
> Cyril


Re: [CDO] CDOFeatureDelta => ADD with null [message #529790 is a reply to message #529680] Tue, 27 April 2010 08:24 Go to previous messageGo to next message
Cyril Jaquier is currently offline Cyril JaquierFriend
Messages: 80
Registered: July 2009
Member
Hi Eike,

> This is certainly not good. No harm is done to the database though. If
> you file a bugzilla we can look into optimizing this. Thanks for
> pointing this out.
>

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

I attached a test case to the bugzilla. While testing the test case (!!)
I got a dynamic EClass where I would have expected the generated one. I
would really like to understand why.

Thank you :-)

Cheers,
Cyril
Re: [CDO] CDOFeatureDelta => ADD with null [message #529791 is a reply to message #529790] Tue, 27 April 2010 08:49 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 27.04.2010 10:24, schrieb Cyril Jaquier:
> Hi Eike,
>
>> This is certainly not good. No harm is done to the database though.
>> If you file a bugzilla we can look into optimizing this. Thanks for
>> pointing this out.
>>
>
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=310574
Thanks!

>
> I attached a test case to the bugzilla. While testing the test case
> (!!) I got a dynamic EClass where I would have expected the generated
> one. I would really like to understand why.
I fixed that yesterday after a debug session with Erwin ;-)

Cheers
/Eike

----
http://thegordian.blogspot.com
http://twitter.com/eikestepper


>
> Thank you :-)
>
> Cheers,
> Cyril


Re: [CDO] CDOFeatureDelta => ADD with null [message #529795 is a reply to message #529791] Tue, 27 April 2010 09:10 Go to previous messageGo to next message
Cyril Jaquier is currently offline Cyril JaquierFriend
Messages: 80
Registered: July 2009
Member
Eike Stepper wrote:
> Am 27.04.2010 10:24, schrieb Cyril Jaquier:
>> Hi Eike,
>>
>>> This is certainly not good. No harm is done to the database though.
>>> If you file a bugzilla we can look into optimizing this. Thanks for
>>> pointing this out.
>>>
>>
>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=310574
> Thanks!
>

Bitte ;-)

>> I attached a test case to the bugzilla. While testing the test case
>> (!!) I got a dynamic EClass where I would have expected the generated
>> one. I would really like to understand why.
> I fixed that yesterday after a debug session with Erwin ;-)
>

Oh great :-) I don't think we have the fix in our repository yet. But
I'm looking forward to test it (and thus remove some fixme/todo in my code).

Cheers,
Cyril
Re: [CDO] CDOFeatureDelta => ADD with null [message #531225 is a reply to message #529795] Tue, 04 May 2010 08:50 Go to previous message
Cyril Jaquier is currently offline Cyril JaquierFriend
Messages: 80
Registered: July 2009
Member
Hi Eike,

>>> I attached a test case to the bugzilla. While testing the test case
>>> (!!) I got a dynamic EClass where I would have expected the generated
>>> one. I would really like to understand why.
>> I fixed that yesterday after a debug session with Erwin ;-)
>>
>
> Oh great :-) I don't think we have the fix in our repository yet. But
> I'm looking forward to test it (and thus remove some fixme/todo in my
> code).
>

Now I get instances of the generated classes (as expected) :-) Thank you.

Cheers,
Cyril
Previous Topic:Looking for examples of EContentAdapter usage
Next Topic:Retain original resource reference when copying entries between feature maps
Goto Forum:
  


Current Time: Fri Apr 26 09:31:16 GMT 2024

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

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

Back to the top