jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paco Avila <pav...@git.es>
Subject Re: two questions about locks
Date Mon, 20 Nov 2006 11:15:18 GMT
El lun, 20-11-2006 a las 11:59 +0200, Jukka Zitting escribió:
> Hi,
> 
> On 11/20/06, Paco Avila <pavila@git.es> wrote:
> > 1.- How can I see the lock token associated to a lock?
> 
>    Lock.getLockToken()

But if the lock token is lost, null is returned. But the node is locked.

> > 2.- How can I unlock a node if the lock tokes is lost?
> 
> If the lock token is truly lost, you can try fishing it from the
> "locks" file managed by the o.a.j.core.lock.LockManagerImpl class.
> Once you've recovered the lock token, you can attach it to a session
> and unlock the lock normally:
> 
>     Session.addLockToken()
>     Node.unlock()

LockManagerImpl read tokens from the "workspaces/default/locks" file.
Currently I have a node locked, but the lock tokens not is in this file
(i don't know why). So, I have another two questions:

1.- Can I eliminate this lock manually editing any low-level xml
descriptor. Actually my repositorio uses LocalFileSystem and the
XMLPersistenceManager. I thing this lock condition should be in any XML
file...

2.- If I want to get a list of locked nodes should I search all the
nodes in my repository and test the lock condition or there is any best
way (using an internal jackrabbit class)?

-- 
Paco Avila <pavila@git.es>


Mime
View raw message