jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stefan Guggisberg" <stefan.guggisb...@gmail.com>
Subject Re: lock question
Date Wed, 12 Sep 2007 12:32:31 GMT
On 9/12/07, Carsten Ziegeler <cziegeler@apache.org> wrote:
> Stefan Guggisberg wrote:
> > 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();
> >
> >
> Is it required to remove the lock token from the first session?

if you log out the first session before you transfer the lock token, no.
otherwise you'll have to remove it since only one session can hold
a particular lock token.

cheers
stefan

>
> Carsten
>
> --
> Carsten Ziegeler
> cziegeler@apache.org
>

Mime
View raw message