Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 339064 - Let CDOSession.waitForUpdate() wait for updates on all views
Summary: Let CDOSession.waitForUpdate() wait for updates on all views
Status: CLOSED FIXED
Alias: None
Product: EMF
Classification: Modeling
Component: cdo.core (show other bugs)
Version: 4.0   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Caspar D. CLA
QA Contact: Eike Stepper CLA
URL:
Whiteboard:
Keywords: noteworthy
Depends on:
Blocks:
 
Reported: 2011-03-07 04:38 EST by Caspar D. CLA
Modified: 2011-06-23 03:42 EDT (History)
1 user (show)

See Also:
stepper: review+


Attachments
Patch (953 bytes, patch)
2011-03-07 04:48 EST, Caspar D. CLA
no flags Details | Diff
Patch v2 (1.30 KB, patch)
2011-03-07 05:38 EST, Caspar D. CLA
no flags Details | Diff
Patch v3 (1.30 KB, patch)
2011-03-07 05:54 EST, Caspar D. CLA
no flags Details | Diff
Patch v4 (1.30 KB, patch)
2011-03-09 01:36 EST, 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 Caspar D. CLA 2011-03-07 04:38:43 EST
Presumably, this method allows the caller to wait for the results
of another commit to come in. When the caller unblocks, he should
be able to assume that the results of that commit have been 
processed locally.

But the #notifyAll call is made from CDOSessionImpl.setLastUpdateTime, 
which is called from #invalidateOrdered, which calls setLastUpdateTime
*before* doing the invalidations. As a result, the thread that called
#waitForUpdate will resume execution before the invalidation is
complete, and may therefore encounter local data that has not yet
incorporated the commitNotification data.
Comment 1 Caspar D. CLA 2011-03-07 04:48:13 EST
Created attachment 190528 [details]
Patch
Comment 2 Caspar D. CLA 2011-03-07 05:38:55 EST
Created attachment 190532 [details]
Patch v2

Original patch didn't achieve it's goal because invalidation is
being called asynchronously.

New patch has session.waitForUpdate call view.waitForUpdate for
every view.
Comment 3 Caspar D. CLA 2011-03-07 05:54:21 EST
Created attachment 190534 [details]
Patch v3
Comment 4 Eike Stepper CLA 2011-03-09 01:36:52 EST
Created attachment 190728 [details]
Patch v4

simple reformat
Comment 5 Eike Stepper CLA 2011-03-09 01:38:15 EST
Your English is so perfect, can you add specific JavaDoc in CDOSession?
Comment 6 Caspar D. CLA 2011-03-09 05:54:57 EST
(In reply to comment #5)
> Your English is so perfect, 

Riiiiiiiight... I feel special now, and not at all inveigled
into performing the below chore, hehe.

> can you add specific JavaDoc in CDOSession?

I guess you mean in CDOSessionImpl, since the declaration
in CDOUpdateable is already documented? Please confirm.
Comment 7 Eike Stepper CLA 2011-03-09 08:22:06 EST
Should have been more specific. Please override the method from CDOUpdatable in CDOSession.java, just to add JavaDoc with the special semantics you're implying now ;-)
Comment 8 Caspar D. CLA 2011-03-10 00:40:13 EST
Committed rev. 7427
Comment 9 Caspar D. CLA 2011-03-10 00:42:38 EST
Committed revision 7432. (JavaDoc as requested.)
Comment 10 Eike Stepper CLA 2011-03-10 02:34:37 EST
I wonder if it will cause confusion that CDOSession.getLastUpdateTime() may return a time X before CDOSession.waitForUpdate(X) unblocks...
Comment 11 Eike Stepper CLA 2011-03-10 02:34:47 EST
Committed revision 7434:
- trunk/plugins/org.eclipse.emf.cdo
Comment 12 Caspar D. CLA 2011-03-10 03:08:02 EST
(In reply to comment #10)
> I wonder if it will cause confusion that CDOSession.getLastUpdateTime() may
> return a time X before CDOSession.waitForUpdate(X) unblocks...

Nah, it won't :-)
Comment 13 Eike Stepper CLA 2011-03-10 03:13:01 EST
Smart answer :P

Not sure I agree, though. Let's see if someone else will complain...
Comment 14 Eike Stepper CLA 2011-06-23 03:42:18 EDT
Available in R20110608-1407