Skip to main content



      Home
Home » Modeling » EMF » [CDO] CDOViewInvalidationEvent: can I know which CDOSession provoked it?
icon5.gif  [CDO] CDOViewInvalidationEvent: can I know which CDOSession provoked it? [message #1061966] Wed, 05 June 2013 03:49 Go to next message
Eclipse UserFriend
Hi,

In my editors, I register an IListener to the CDOView. When the CDOView receives a CDOViewInvalidationEvent, is it possible to know the origin CDOView or CDOSession that provoked this invalidation? This event only has methods to retrieve the detached and dirty objects, the revision delta and the view source, that coincides with the view of the editor, so it's not valid for me.

Cheers,
Marc
Re: [CDO] CDOViewInvalidationEvent: can I know which CDOSession provoked it? [message #1061989 is a reply to message #1061966] Wed, 05 June 2013 05:38 Go to previous messageGo to next message
Eclipse UserFriend
CDOSession or CDOView IDs do not have a lasting meaning. Even if the server would distribute them there would be no guarantee that it can be used in some meaningful way at the time the invalidation event is received. The userID of the CDOSession and the CDOCommitInfo are different, though. You can get access to it directly through the CDOSessionInvalidationEvent (which is a CDOCommitInfo) or use the CDOCommitInfoManager to retrieve the CDOCommitInfo for the time returned by CDOViewInvalidationEvent.getTimeStamp().

Does that help?

Cheers
/Eike

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

Re: [CDO] CDOViewInvalidationEvent: can I know which CDOSession provoked it? [message #1061990 is a reply to message #1061989] Wed, 05 June 2013 05:50 Go to previous messageGo to next message
Eclipse UserFriend
mmm Not sure... Or maybe I don't really understand... Imagine these 2 scenarios:

Scenario 1
**********
- User A opens a session.
- User A opens the resource X with its editor.
- User A opens the resource Y with its editor (related with resource X).
- User A modifies resource X and save.
- Editor with resource Y receive the Invalidation and can notify the user.

Scenario 2
**********
- User A opens a session.
- User A opens the resource X with its editor.
- User B opens a session.
- User B opens the resource Y with its editor (related with resource X).
- User A modifies resource X and save.
- User B receives a notification via the editor with resource Y, who received the Invalidation.

Two scenarios are similar, the only difference is that there are 2 different sessions. But in the scenario 1, due to the modifications are done by the same session, I don't want to notify the user, cause he knows that he's modifying the resources. In the scenario 2, user should be notified, cause another user has modified any resource.

Is it possible to do with your provided information?

Cheers,
Marc
Re: [CDO] CDOViewInvalidationEvent: can I know which CDOSession provoked it? [message #1061992 is a reply to message #1061990] Wed, 05 June 2013 05:57 Go to previous messageGo to next message
Eclipse UserFriend
You can use CDOSessionInvalidationEvent.getLocalTransaction() which returns null if teh commit comes from a different session.

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
Re: [CDO] CDOViewInvalidationEvent: can I know which CDOSession provoked it? [message #1061994 is a reply to message #1061992] Wed, 05 June 2013 06:03 Go to previous messageGo to next message
Eclipse UserFriend
That's what I need Smile Thanks a lot Eike!

Cheers,
Marc
Re: [CDO] CDOViewInvalidationEvent: can I know which CDOSession provoked it? [message #1061998 is a reply to message #1061994] Wed, 05 June 2013 06:41 Go to previous messageGo to next message
Eclipse UserFriend
You're welcome. Please note that a CDOSessionInvalidationEvent is emitted *before* the views and transactions are invalidated/notified. Compare CDOSessionImpl.invalidateOrdered().

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
Re: [CDO] CDOViewInvalidationEvent: can I know which CDOSession provoked it? [message #1062002 is a reply to message #1061998] Wed, 05 June 2013 07:12 Go to previous message
Eclipse UserFriend
I used the CDOSessionInvalidationEvent to notify the user if the changes comes from a remote session, and the CDOViewInvalidationEvent to refresh the editor with the changes.

Thanks again,
Marc
Previous Topic:[EMF Compare] Graphical Representation (solved)
Next Topic:EMF's Jet templates costumization
Goto Forum:
  


Current Time: Sun Jul 13 07:21:24 EDT 2025

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

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

Back to the top