jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cédric Damioli <cedric.dami...@anyware-tech.com>
Subject Lock removed when shutdown/restart of the Repository ?
Date Fri, 17 Jun 2005 10:28:36 GMT
Hi,

I encountered a strange problem (using jackrabbit from yesterday) :
I locked a Node, Node.isLocked() returns true, then shutdown/restart of 
my Servlet app (implying shutdown/restart of the Respository itself) and 
then, Node.isLocked() returns... false !!
Is the locked state of a Node not yet persisted ?
Or am I missing something important ?

The second point is when using a Lock which is not session scoped, I 
can't unlock it with another Session, even when adding the LockToken.
My code is equivalent to the following :

node.lock();

lt = node.getLock().getLockToken();

s1 = node.getSession();

s1.logout();

s2 = repo.login();

s2.addLockToken(lt);

node2 = s2.getItem(...);

node2.unlock() -> LockException("Node not locked by session");


Actually, the s1.logout() does not remove the LockToken from s1. And the 
LockInfo still references s1.
So when s2 tries to addLockToken, the LockManagerImpl.lockTokenAdded() 
does not the job saying "lock already held by other session".
If before logging out from s1, I do s1.removeLockToken(s1), all works 
correctly.

Is it an expected behaviour ?

I hope to have been quite clear :-)

Does someone have a pointer in the code, so that I can take a look inside ?

Regards,
Ced

-- 
Cédric Damioli
ANYWARE TECHNOLOGIES
Tel : +33 (0)5 61 00 52 90
Fax : +33 (0)5 61 00 51 46
http://www.anyware-tech.com


Mime
View raw message