Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 316887 - Databinding & CDO Notifications
Summary: Databinding & CDO Notifications
Status: CLOSED FIXED
Alias: None
Product: EMF
Classification: Modeling
Component: cdo.core (show other bugs)
Version: 4.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Eike Stepper CLA
QA Contact: Eike Stepper CLA
URL:
Whiteboard: offline-01
Keywords:
Depends on:
Blocks: 318347
  Show dependency tree
 
Reported: 2010-06-15 08:13 EDT by Michael Szediwy CLA
Modified: 2011-06-23 03:38 EDT (History)
4 users (show)

See Also:


Attachments
Patch v1 - for future reference (61.24 KB, patch)
2010-06-29 11:33 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-15 08:13:03 EDT
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 Eike Stepper CLA 2010-06-29 04:54:43 EDT
Rebasing all outstanding 3.0 problem reports to version 3.0.1
Comment 2 Eike Stepper CLA 2010-06-29 11:33:22 EDT
Created attachment 173018 [details]
Patch v1 - for future reference
Comment 3 Eike Stepper CLA 2010-06-29 11:42:35 EDT
Committed to HEAD
Comment 4 Eike Stepper CLA 2010-07-07 07:10:39 EDT
Fixing wrong bug version.
Comment 5 Eike Stepper CLA 2010-09-10 07:34:55 EDT
According to the date of the fix this should be 4.0
Comment 6 Eike Stepper CLA 2011-06-23 03:38:49 EDT
Available in R20110608-1407