if i login again i try this code .. LockManager lockManager = ((SessionImpl)session).getLockManager(); lockManager.holdsLock((NodeImpl)foo); //returns true
Lock myLock = lockManager.getLock((NodeImpl)foo); myLock.getLockOwner(); //returns valid userid myLock.isSessionScoped(); //returns true lockManager.isLockHolder(session, (NodeImpl)foo); //returns false myLock.getLockToken(); //returns null ! greets claus -----Ursprüngliche Nachricht----- Von: KÖLL Claus [mailto:[EMAIL PROTECTED] Gesendet: Mittwoch, 12. September 2007 14:57 An: [email protected] Betreff: AW: lock question 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 ? thanks claus -----Ursprüngliche Nachricht----- Von: Stefan Guggisberg [mailto:[EMAIL PROTECTED] Gesendet: Mittwoch, 12. September 2007 14:33 An: [email protected] Betreff: Re: lock question On 9/12/07, Carsten Ziegeler <[EMAIL PROTECTED]> 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 > [EMAIL PROTECTED] >
