Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 339064

Summary: Let CDOSession.waitForUpdate() wait for updates on all views
Product: [Modeling] EMF Reporter: Caspar D. <caspar_d>
Component: cdo.coreAssignee: Caspar D. <caspar_d>
Status: CLOSED FIXED QA Contact: Eike Stepper <stepper>
Severity: enhancement    
Priority: P3 CC: saulius.tvarijonas
Version: 4.0Keywords: noteworthy
Target Milestone: ---Flags: stepper: review+
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Patch
none
Patch v2
none
Patch v3
none
Patch v4 none

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