|
|
|
Re: [CDO] Administrating CDOLocks [message #1841443 is a reply to message #1841297] |
Mon, 17 May 2021 07:33 |
|
Via https://bugs.eclipse.org/bugs/show_bug.cgi?id=573570 I've provided a few convenience methods in CDOServerUtil that make your code a little simpler:
private void clearLocks(CDOSession session)
{
CDOServerUtil.run(session, () -> {
InternalLockManager lm = (InternalLockManager)CDOServerUtil.getRepository(session).getLockingManager();
String userID = session.getUserID();
lm.getLockAreas(userID, area -> {
if (area.getUserID().equals(userID))
{
area.getLocks().clear();
lm.updateLockArea(area); // this effectively removes the locks. But no unlock notifications are being sent.
lm.deleteLockArea(area.getDurableLockingID()); // if I do not delete the lock area, there will be exceptions
// on the client if the view is currently open
}
return true;
});
});
}
Remaining are the following concerns:
1) When locks of a client view X are released on the server the other client views should receive lock notifications.
2) What should happen to view X? If it's durable then it can be an open client view, but it doesn't necessarily have to be open. Should it stay durable (just with all/certain) locks released? Then it should probably be notified about released locks, too. If durability itself is terminated on the server AND if it's open on the client, should that be notified somehow? Or, if the view is open, could it just be closed from the server?
3) What is the exception/stacktrace that you mention during deleteLockArea()?
You see, lots of questions regarding the requirements. What do you think?
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02839 seconds