Hi,

On Sat, May 24, 2008 at 6:12 PM, viz06 <[EMAIL PROTECTED]> wrote:
> I have a very simple setup using spring module jcrTemplate. I am able to lock
> a node using
>
> Lock nodeLock = jcrTemplate.getNodeByUUID(<myUUID>).lock(false, false);
>
> and this is how I am attempting unlocking
>
> jcrTemplate.getSessionFactory().getSession().addLockToken(nodeLock
> .getLockToken());
>
> jcrTemplate.getNodeByUUID(<myUUID>).unlock();

Do you still have a reference to the original Node instance that you
locked. The easiest way to unlock it is to call unlock() on that node
instance as it's still associated with the session that originally
locked the node.

Otherwise, try the following code snippet, as the lock token needs to
be associated with the same session that does the unlocking:

    Node node = jcrTemplate.getNodeByUUID(<myUUID>);
    node.getSession().addLockTiken(<lockToken>);
    node.unlock();

BR,

Jukka Zitting

Reply via email to