Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 324950 - Databinding & CDO Notifications
Summary: Databinding & CDO Notifications
Status: CLOSED FIXED
Alias: None
Product: EMF
Classification: Modeling
Component: cdo.core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Egidijus Vaisnora CLA
QA Contact: Eike Stepper CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 318347
  Show dependency tree
 
Reported: 2010-09-10 07:38 EDT by Egidijus Vaisnora CLA
Modified: 2012-09-21 06:50 EDT (History)
0 users

See Also:
stepper: review+


Attachments
Ported patch from head (53.45 KB, patch)
2010-09-10 07:49 EDT, Egidijus Vaisnora CLA
no flags Details | Diff
Patch v2 - do not commit (51.08 KB, patch)
2010-09-11 05:05 EDT, Eike Stepper CLA
no flags Details | Diff
Failure List (79.83 KB, text/plain)
2010-09-11 05:16 EDT, Eike Stepper CLA
no flags Details
Patch v3 updated (56.22 KB, patch)
2010-09-27 10:05 EDT, Egidijus Vaisnora CLA
no flags Details | Diff
Patch v4 - ready to be committed (56.72 KB, patch)
2010-10-04 04:19 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 Egidijus Vaisnora CLA 2010-09-10 07:38:07 EDT
Cloned from: 316887: Databinding & CDO Notifications
https://bugs.eclipse.org/bugs/show_bug.cgi?id=316887

Build Identifier: 

Situation at the moment:

- CDO fires notifications before the conflict resolver gets called during invalidation.
- Databinding relies on correct notifications fired.

As an example take two transaction T1 and T2. The model contains an object O1 that has a many reference list to other objects. The list contains following elements:

[a,b,c,d,e,f,g]

Within transaction T1 the operation MOVE 0 -> 6 is executed. No commit at the moment.
Within transaction T2 the operation REMOVE 2 is executed. No commit at the moment.

Situation after the two operations:

T1: [b,c,d,e,f,g,a]
T2: [a,b,d,e,f,g]

Then commit T1. T2 gets the invalidation. The object containing the list is marked as conflict. Next step is to create and fire the notification. The binding which has added an adapter to the object O1 to synchronize the model and the target list gets the MOVE 0->6 notification. But there is no element at index 6 what causes an IndexOutOfBounds exception. The databinding has an inconsistent state.

After the notifications are distributed the conflict resolver is called. which solves the conflict.

As there are many more such examples it would be better first call the conflict resolver and afterwards fire the notification. Of course a mechanism to patch the notifications should be provided.

Reproducible: Always
Comment 1 Egidijus Vaisnora CLA 2010-09-10 07:49:45 EDT
Created attachment 178607 [details]
Ported patch from head
Comment 2 Eike Stepper CLA 2010-09-11 05:05:40 EDT
Created attachment 178673 [details]
Patch v2 - do not commit

It took me several hours to make your patch binary compatible. Now a few tests are failing. Please try to find out why and fix it. Then I'll review again...
Comment 3 Eike Stepper CLA 2010-09-11 05:16:34 EDT
Created attachment 178674 [details]
Failure List
Comment 4 Egidijus Vaisnora CLA 2010-09-27 10:05:52 EDT
Created attachment 179643 [details]
Patch v3 updated

Collected fixes from several commits. Please, review.
Comment 5 Eike Stepper CLA 2010-10-04 04:19:34 EDT
Created attachment 180139 [details]
Patch v4 - ready to be committed

This time it looks good ;-)
Comment 6 Egidijus Vaisnora CLA 2010-10-04 05:02:28 EDT
Committed to R3_0maintenance
Comment 7 Egidijus Vaisnora CLA 2010-10-04 05:05:40 EDT
Fixed
Comment 8 Eike Stepper CLA 2010-11-16 01:03:25 EST
Changing version to 3.0.

Let's only use major versions to indicate the development stream. If more precise baseline info is needed let's insert a time stamp in a comment.
Comment 9 Eike Stepper CLA 2011-06-23 04:27:34 EDT
Moving all open problem reports to 4.0
Comment 10 Eike Stepper CLA 2012-09-21 06:50:59 EDT
Closing.