|
Re: [CDO] react on remote model changes [message #930439 is a reply to message #930417] |
Tue, 02 October 2012 10:07 |
|
Am 02.10.2012 11:47, schrieb Christian Stellwag:
> Hello Forum Readers,
>
> I need some clarification on this topic.
> Using CDO version 4.0.99 in a client/server application (RCP) we need mechanism to update clients when underlying data
> was changed (usually by different user).
What does 4.0.99 mean?
> Our current implementation registers as IListener on the CDOView and receives
> notifyEvent(IEvent) change notifications.
>
> As I understood from reading forum entries and docu this is one out of 3 possibilities to get informed
> (CDOSession.addListener and object.eAdapter().add(yourAdapter) being the other 2).
Yes, actually there's an old fourth way: CDOInvalidationNotification from pre-CDODeltaNotification times.
> From Debugging the application I learned that notifyEvent is called twice,
> first time with IEvent being CDOViewInvalidationEvent carrying information about what has changed (getDirtyObjects()
> and getDetachedObjects()).
> Second time with CDOViewAdaptersNotifiedEvent.
>
> Since I somehow rely on both events in this sequence my questions are:
> - Is there a guarantee that both event notifications are submitted?
> - in exactly this order?
Yes and yes. Have a look at CDOViewImpl.doInvalidate() where the events/notifications are emitted in the following order:
sendInvalidationNotifications();
fireInvalidationEvent();
if (!deltas.isEmpty() || !detachedObjects.isEmpty())
{
sendDeltaNotifications(deltas, detachedObjects, oldRevisions);
}
fireAdaptersNotifiedEvent(lastUpdateTime);
> I didn't find any exact documentation about this. Does it exist? Where?
The docs are incomplete? You're kidding! :P
> Would you rather recommend to only consume CDOViewInvalidationEvent and ignore CDOViewAdaptersNotifiedEvent?
No. It all depends on what you want to achieve.
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
|
|
|
|
Powered by
FUDForum. Page generated in 0.02942 seconds