Use of IObjectActionDelegate not Synchronized [message #536511] |
Fri, 28 May 2010 14:26  |
Austin Riddle Messages: 128 Registered: July 2009 |
Senior Member |
|
|
Hello,
In 1.3, I have discovered something startling, which I am positive is because of our false assumptions about how action delegates work.
I am surprised this never came up in our development before, but after doing some multi-user testing, we discovered that the use of any particular IObjectActionDelegate is shared among all users of the RAP application at any given time.
The startling part about this is that it implies that the action delegate cannot store any state including the selection that comes from selectionChanged(IAction,ISelection).
In our IObjectActionDelegates, we have been storing the selection for use when the run() method is called. But this obviously has implications in a multiuser environment when one action delegate is shared between users.
So our initial thought was to somehow store the selection in the target part that comes from setActivePart(), but that also would break in the multi-user case....
To reproduce the effect, just fire up 2 instances of your app... put a breakpoint in selectionChanged(), run() and setActivePart(). Then right click different elements that would use the same delegate (on in each app instance). You will find that the two threads are waiting on setActivePart()...which demonstrates the problem...
namely that two users that right click on different objects in different sessions can end up stepping on each other's selection if you store the selection in the delegate.
Does anyone else know how to deal with this issue? We are stumped. We use a lot of IObjectDelegates that worked fine in RCP.
Thanks!
[Updated on: Fri, 28 May 2010 21:21] Report message to a moderator
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03295 seconds