Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO] Notifications
[CDO] Notifications [message #781272] Fri, 20 January 2012 22:06 Go to next message
Per Sterner is currently offline Per SternerFriend
Messages: 91
Registered: October 2011
Member
Hello,

I have read a lot but I am still unsure.

1. I have an osgi runtime with a CDO Repo runnig.
2. I have another osgi runtime with a CDO session to the repo & a read only view. But this instance doesn't touch any item at startup.

If I now change the model instance in the repo, I'd like to get 'CDOView events' with deltas.

For now I have manually added a CDO session listener which touches the changed object (if it is interesting) and then I get CDOView events. This solution is probably no good idea because I only get deltas for the currently cached objects?

Can I configure CDO to achieve this without the session listener?

Regards,

Per

[Updated on: Fri, 20 January 2012 22:08]

Report message to a moderator

Re: [CDO] Notifications [message #781424 is a reply to message #781272] Sat, 21 January 2012 07:23 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 20.01.2012 23:06, schrieb Missing name Mising name:
> Hello,
>
> I have read a lot but I am still unsure.
>
> 1. I have an osgi runtime a CDO Repo runnig. 2. I have another osgi runtime CDO session to the repo & a read only
> view. But this instance doesn't touch any item at startup.
Can you be more prcise? What instance, what is "touch", what is "item", what is startup?

>
> If I now change the model instance in the repo, I'd like to get 'CDOView events' with deltas.
You should either:

view.getSession().options().setPassiveUpdateMode(PassiveUpdateMode.CHANGES / .ADDITIONS);

or (more selectively):

view.options().addChangeSubscriptionPolicy(CDOAdapterPolicy.ALL);

>
> For now I have manually added a CDO session listener which touches the changed object (if it is interesting)
What means "touches"? A CDOSession does not know about EObjects.

> and then I get CDOView events.
You mean CDOSessionInvalidationEvents?

> This solution is probably no good idea because I only get deltas for the currently cached objects?
I don't understand your solution because you seem to be messing up sessions and views (which know about EObjects).

>
> Can I configure CDO to achieve this without the session listener?
Achieve what? Receive all changes? Have a look how
org.eclipse.emf.cdo.internal.server.syncing.RepositorySynchronizer.RemoteSessionListener uses CDOSessionInvalidationEvents.

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


Re: [CDO] Notifications [message #782895 is a reply to message #781424] Tue, 24 January 2012 16:59 Go to previous message
Per Sterner is currently offline Per SternerFriend
Messages: 91
Registered: October 2011
Member
Thank you for your fast answer and sorry for my late response,

With touch I mean this program doesn't access any object from a resource. So the view has not accessed any EObject.

With the session and 'view.getSession().options().setPassiveUpdateMode(PassiveUpdateMode.CHANGES / .ADDITIONS);' I get all changed/new CDOIDs with a session listener.

But in my CDOView listener a don't get any InvalidationEvents only a CDOViewAdaptersNotifiedEvent. This is (?) correct because the changed items are not invalid because they have not been accessed in the view yet.

Now I added a CDOSessionListener with a 'brutal' loop over the changed and new OIDs and fetch each one of interest for the view.
while (itChanged.hasNext()) {
   CDORevisionKey key = itChanged.next();
   CDOView cdoView = ...;
   CDOObject item = cdoView.getObject(key.getID());
}

After this the CDOView gets invalidation events for the EObjects.

This method seems 'brutal' but it produces all attribute change deltas even if the view did not access an EObject until the session listener noticed the change.

I am looking into 'org.eclipse.emf.cdo.internal.server.syncing.RepositorySynchronizer.RemoteSessionListener.'

Thanks,

Per
Previous Topic:[EMF] Resolving and non resolving list methods
Next Topic:EMF / GWT Datastore Contention Issues / Failed to Save
Goto Forum:
  


Current Time: Fri Mar 29 07:52:52 GMT 2024

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

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

Back to the top