|[CDO] Facing troubles when trying to use lock mechanism [message #1841453]
||Mon, 17 May 2021 13:25
| Xavier GISTAU
Registered: February 2019
Hello everyone, I hope you are all doing well ! |
I have been using CDO for some months now and I am again coming here to ask you for some hints and help !
I am now trying to use the lock/unlock mechanism provided by CDO.
My architecture is the following :
- I have a CDO repo where my "shared model" is stored.
- I have two clients : Client A and Client B, that use a "locally stored" model synced with the shared one
I am trying to use the cdo.lock, so when a user is modifying an element of the model, the EObject gets locked until the modification is saved.
To achieve that I use:
- CDOTransaction to commit the changes, and also
- a SessionListener that reacts to the
that are happening in the CDORepo and reproduce the lock/unlock mechanism locally.
The problem I am facing is that when saving my changes(commiting it to the CDORepo), it seems that a CDOSessionLocksChangedEvent is thrown, even though my method using cdoObject.cdoWriteLock().unlock is not called yet. I have found that there is this option
that should stop these autorelease event. I have noticed that, indeed, when Client A is commiting its changes, Client B does not receive the autoRelease event.
But it seems like the SessionListener of Client A still receives this "autorelease lock event", from its own modifications and I don't know how to prevent that, because this "autorelease event" does not have any lockChangeInfo, in fact the lockChangeInfo is null.
So I am wondering, is there a way for a sessionListener to ignore the notification created by itself ? If not, then what should I use to implement the lock/unlock mechanism ?
Thank you for your time and help, have a great day !
Powered by FUDForum
. Page generated in 0.01297 seconds