jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From KÖLL Claus <C.KO...@TIROL.GV.AT>
Subject AW: lock question
Date Wed, 12 Sep 2007 13:47:10 GMT
i get the lock problems with the webdav servlet
in some rarely situations like a user quits the ms word by the taskmanager
the webdav servlet can not release the lock from the node and
so i have a node with a lock and i can not remove it 

what can i do ?

claus


-----Ursprüngliche Nachricht-----
Von: Stefan Guggisberg [mailto:stefan.guggisberg@gmail.com] 
Gesendet: Mittwoch, 12. September 2007 15:08
An: users@jackrabbit.apache.org
Betreff: Re: lock question

On 9/12/07, KÖLL Claus <C.KOELL@tirol.gv.at> wrote:
> hi stefan,
>
> first thanks for the infos.
> how can i remove the lock if i can not save the lock token from the first session.
>
> something like this ..
>
> session.getRootNode().getNode("path/to/lockable/node").lock(true, false);
> now log out ..
> login again and remove the lock .. how ?

you need to retrieve the lock token *before* the session logs out,
e.g. by calling

    Lock lock = ....lock(true, false);
    String token = lock.getLockToken();

or

    // about to log out...
    String[] tokens = session.getLockTokens();

>
> thanks
> claus
>
> -----Ursprüngliche Nachricht-----
> Von: Stefan Guggisberg [mailto:stefan.guggisberg@gmail.com]
> Gesendet: Mittwoch, 12. September 2007 14:33
> An: users@jackrabbit.apache.org
> Betreff: Re: lock question
>
> 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