Skip to main content



      Home
Home » Modeling » EMF » [CDO] react on remote model changes(IListener (CDOView) notifyEvent consumption)
[CDO] react on remote model changes [message #930417] Tue, 02 October 2012 05:47 Go to next message
Eclipse UserFriend
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).

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).

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?

I didn't find any exact documentation about this. Does it exist? Where?

Would you rather recommend to only consume CDOViewInvalidationEvent and ignore CDOViewAdaptersNotifiedEvent?

Thanx in advance,
Chris
Re: [CDO] react on remote model changes [message #930439 is a reply to message #930417] Tue, 02 October 2012 06:07 Go to previous messageGo to next message
Eclipse UserFriend
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
Re: [CDO] react on remote model changes [message #930460 is a reply to message #930439] Tue, 02 October 2012 06:37 Go to previous message
Eclipse UserFriend

Hi Eike,

Thank you very much for your quick answer.
You provided all necessary information for me.

Cheers, Chris
Previous Topic:[CDO] NPE when requesting an EObject from a different view that is TRANSIENT
Next Topic:[CDO] Querying HREFs in the repository
Goto Forum:
  


Current Time: Wed Jul 23 06:13:06 EDT 2025

Powered by FUDForum. Page generated in 0.26483 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top