Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 365719 - Disambiguate CDOView.enableDurableLocking(boolean)
Summary: Disambiguate CDOView.enableDurableLocking(boolean)
Status: CLOSED FIXED
Alias: None
Product: EMF
Classification: Modeling
Component: cdo.core (show other bugs)
Version: 4.1   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Eike Stepper CLA
QA Contact: Eike Stepper CLA
URL:
Whiteboard: Power to the People
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-06 08:07 EST by Matthieu Helleboid CLA
Modified: 2012-09-21 07:18 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matthieu Helleboid CLA 2011-12-06 08:07:36 EST
When deleting a LockArea using IDurableLockingManager.deleteLockArea(id), associated locks are not deleted and objects are still locked.

For a dbStore, associated locks are only deleted from the database, and objects will only appears as unlocked after a server restart.
Comment 1 Caspar D. CLA 2011-12-06 23:39:41 EST
IDurableLockingManager is only responsible for dealing with the persistent
aspect of locks, see the JavaDoc, so the current implementation of
#deleteLockArea is correct insofar as it does (only) what the API says it
should do. This method is meant to allow the persistent representation to
be removed, without necessarily releasing the in-memory locks. That is, it
is invoked when the user calls CDOView.enableDurableLocking(false).

To delete the in-memory locks, just call CDOView.unlockObjects().
Comment 2 Matthieu Helleboid CLA 2011-12-07 19:26:54 EST
CDOView.unlockObjects() works just fine, Thanks a lot.
Sorry, I'm have been misled by some previous discussions about this.
Comment 3 Eike Stepper CLA 2011-12-08 01:01:46 EST
I'll deprecate the existing method and add these two:

    public String enableDurableLocking();
    public void disableDurableLocking(boolean releaseLocks);
Comment 4 Eike Stepper CLA 2011-12-08 02:39:36 EST
commit 61519d15b81df73cbe362efe4c02b924a6992acc
Author: Eike Stepper <stepper@esc-net.de> 2011-12-08 08:39:19
Committer: Eike Stepper <stepper@esc-net.de> 2011-12-08 08:39:19
Parent: 821aa1db96646007b7d8a43c4bf3143e6c804867 (Fixed NPE in titlesetter)
Branches: master

[365719] Disambiguate CDOView.enableDurableLocking(boolean) 
https://bugs.eclipse.org/bugs/show_bug.cgi?id=365719
Comment 5 Matthieu Helleboid CLA 2011-12-09 04:44:09 EST
Eike,

These API changes will be helpful, Thanks.

But I think our initial need wasn't really clear. What we needed to do was to delete a lockArea and unlock all the associated objects from another CDO client (later called S).

Let's say client A has made local modifications through pushTransaction and have locks on some objects. But for some reasons, he has lost his session and will never reconnect using this lockArea and be able to unlock objects by himself.

For that we have another special client S, which is able to delete this lock area and also unlock all the associated objects. For that we had to reopen the transaction using the durableLockingId on client S (which is in fact "embedded" in the server) to unlock objects. 

If the lockArea deletion was able to also delete the in-memory locks, client S would be useless.

But so far, we have implement client S, and so it's ok for us.
Comment 6 Eike Stepper CLA 2011-12-09 04:53:25 EST
(In reply to comment #5)
> But I think our initial need wasn't really clear. What we needed to do was to
> delete a lockArea and unlock all the associated objects from another CDO client

Now I'm confused. That sounds exactly like what the releaseLocks parameter on the new disableDurableLocking() method is intended for.
Comment 7 Matthieu Helleboid CLA 2011-12-09 05:00:18 EST
In fact you do not need to have a session (client S) to have access to a IDurableLockingManager and use IDurableLockingManager.deleteLockArea().

But in our usecase, with the fact that IDurableLockingManager only delete persistent representation of a lock area, we either need a server restart or a client S to open a transaction to unlock objects.
Comment 8 Eike Stepper CLA 2011-12-09 06:03:48 EST
So you're complaining that the server's lock manager holds on the locks? I thought it was about a client initiated issue. Investigating...
Comment 9 Eike Stepper CLA 2011-12-09 07:23:57 EST
Sorry, I've misinterpreted this original bugzilla, fixed a different one and resolved this bugzilla. Can you be so kind to open a new one?
Comment 10 Eike Stepper CLA 2012-09-21 07:18:39 EDT
Closing.