On 9/12/07, KÖLL Claus <[EMAIL PROTECTED]> wrote:
> hi,
>
> if i lock a node with
> node.lock(true, false) so that i have a non sessionscoped lock.
>
> the question is how can i remove that lock ?
>
> if i try to do this
> node.unlock()
> i get always "Node not locked by session"
you need to transfer the lock token from the session that created the
lock to the new session., e.g. like this:
Lock lock =
sessionA.getRootNode().getNode("path/to/lockable/node").lock(true,
false);
String token = lock.getLockToken();
sessionA.removeLockToken(token);
...
sessionB.addLockToken(token);
sessionB.getRootNode().getNode("path/to/lockable/node").unlock();
for more information please see "8.4 Locking" in the jsr 170 spec.
cheers
stefan
>
> i have also tried a lot of things with the lockmanager methods but till now
> i cant remove the lock.
>
> thanks for help
> claus
>
>