You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by Paco Avila <pa...@git.es> on 2007/09/06 11:48:15 UTC

about lock tokens

When an user locks a node, a lock token is added to his session. Another
user with this lock token added to his session can unlock the node,
isn't it?

But Jackrabbit test also the lock owner (LockManagerImpl.java line 345),
but the especification says in 8.4.4 "The lock owner's ID is provided
for informational purposes only, it is not tested..." 
-- 
Paco Avila <pa...@git.es>


Re: about lock tokens

Posted by Julian Reschke <ju...@gmx.de>.
Angela Schreiber wrote:
> 
> 
> Dominique Pfister wrote:
>> Hi Paco
>>
>> On 08/09/2007, Paco Avila <pa...@git.es> wrote:
>>> Sorry, I missunderstood the code because confused "lock holder" and
>>> "lock ownser" concepts :(
>>
>> You're not the only one ;) "Lock owner" should rather have been named
>> "lock creator", the current term is absolutely misleading!
> 
> btw. for that reason that has been changed in jsr283:
> 
> quote from '6.9.4 Lock Owner' of the spec available for
> public review:
> 
> "If the lock is open-scoped and its ownership is later switched to 
> another session, the jcr:lockOwner property is automatically changed 
> accordingly. In implementations that support simultaneous lock 
> ownership, the behavior of jcr:lockOwner on the addition of an owner is 
> implementation specific."

Thanks for bringing this up.

This change IMHO is an extremely bad idea, because it requires modifying 
the persisted state of the lock, something which may not be possible to 
build on top of existing systems (for instance, those which implement 
the WebDAV locking model which so far has been a super-set of JCR locking).

BR, Julian

Re: about lock tokens

Posted by Angela Schreiber <an...@day.com>.

Dominique Pfister wrote:
> Hi Paco
> 
> On 08/09/2007, Paco Avila <pa...@git.es> wrote:
>> Sorry, I missunderstood the code because confused "lock holder" and
>> "lock ownser" concepts :(
> 
> You're not the only one ;) "Lock owner" should rather have been named
> "lock creator", the current term is absolutely misleading!

btw. for that reason that has been changed in jsr283:

quote from '6.9.4 Lock Owner' of the spec available for
public review:

"If the lock is open-scoped and its ownership is later switched to 
another session, the jcr:lockOwner property is automatically changed 
accordingly. In implementations that support simultaneous lock 
ownership, the behavior of jcr:lockOwner on the addition of an owner is 
implementation specific."

regards
angela

Re: about lock tokens

Posted by Dominique Pfister <do...@day.com>.
Hi Paco

On 08/09/2007, Paco Avila <pa...@git.es> wrote:
> Sorry, I missunderstood the code because confused "lock holder" and
> "lock ownser" concepts :(

You're not the only one ;) "Lock owner" should rather have been named
"lock creator", the current term is absolutely misleading!

Dominique

Re: about lock tokens

Posted by Paco Avila <pa...@git.es>.
El vie, 07-09-2007 a las 17:26 +0200, Dominique Pfister escribió:
> Hi Paco
> 
> On 06/09/2007, Paco Avila <pa...@git.es> wrote:
> > When an user locks a node, a lock token is added to his session. Another
> > user with this lock token added to his session can unlock the node,
> > isn't it?
> 
> Yes, but only if the first session in your example removes the lock
> token, as there can only be one session having that lock token at a
> given time.

Yes, you are right. Another session had the lock token :/

> >
> > But Jackrabbit test also the lock owner (LockManagerImpl.java line 345),
> > but the especification says in 8.4.4 "The lock owner's ID is provided
> > for informational purposes only, it is not tested..."
> 
> In the specified source code section, the "lock holder" is tested, not
> the "lock owner". The lock owner (or lock creator) is the user id of
> the session, that originally locked the node and purely informational.
> The lock holder is the session currently holding the lock token and is
> therefore allowed to change this node (and its descendants if the lock
> is deep).

Sorry, I missunderstood the code because confused "lock holder" and
"lock ownser" concepts :(

The lock (and lockToken) behavior is ok, my code was incorrect.
Sorry! :)
-- 
Paco Avila <pa...@git.es>


Re: about lock tokens

Posted by Dominique Pfister <do...@day.com>.
Hi Paco

On 06/09/2007, Paco Avila <pa...@git.es> wrote:
> When an user locks a node, a lock token is added to his session. Another
> user with this lock token added to his session can unlock the node,
> isn't it?

Yes, but only if the first session in your example removes the lock
token, as there can only be one session having that lock token at a
given time.

>
> But Jackrabbit test also the lock owner (LockManagerImpl.java line 345),
> but the especification says in 8.4.4 "The lock owner's ID is provided
> for informational purposes only, it is not tested..."

In the specified source code section, the "lock holder" is tested, not
the "lock owner". The lock owner (or lock creator) is the user id of
the session, that originally locked the node and purely informational.
The lock holder is the session currently holding the lock token and is
therefore allowed to change this node (and its descendants if the lock
is deep).

Kind regards
Dominique