You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by Felix Meschberger <fm...@gmail.com> on 2007/08/02 12:37:32 UTC

Re: Is there a way to set lockOwner

Hi,

> In this scenario if i checkout any node the lockowner is always the
> "superuser" i.e session.getUserId()  .Is there a way to set the lockowner
> explicitly.

I am not actually sure, what you are referring to: Locking or
versioning. In case of Versioning, there is no lock owner, as checkout
only sets the checkedOut property. In case of Locking, the specification
is quite clear in section 8.4.4 Lock owner, that the lock owner is set
to the value of Session.getUserID(). There is now way to change this.

You are of course free to create a property where you set your
application level user ID in case of locking. But this is outside of the
spec and purely application level. So your are also responsible to
correctly manage such an added property.

Regards
Felix


Re: Is there a way to set lockOwner

Posted by Felix Meschberger <fm...@gmail.com>.
Hi,

Am Donnerstag, den 02.08.2007, 14:08 +0200 schrieb Angela Schreiber:
> Session.removeLockToken(String) on the session that
> created the lock. and subsequently:
> Session.addLockToken(String) on the other session, that
> should be the new lock holder.

Still the name set is the userID of the Session and not some deliberate
name, as would be required by the initial use case (because all Sessions
are superuser :-) )

Regards
Felix


Re: Is there a way to set lockOwner

Posted by Angela Schreiber <an...@day.com>.
> I am not actually sure, what you are referring to: Locking or
> versioning. In case of Versioning, there is no lock owner, as checkout
> only sets the checkedOut property. In case of Locking, the specification
> is quite clear in section 8.4.4 Lock owner, that the lock owner is set
> to the value of Session.getUserID(). There is now way to change this.

btw. the jcr:lockOwner is for information purpose only.
if you are refering to the 'lock holder', then there
is a way to change it by calling:

Session.removeLockToken(String) on the session that
created the lock. and subsequently:
Session.addLockToken(String) on the other session, that
should be the new lock holder.