You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by JOSE FELIX HERNANDEZ BARRIO <jo...@isthari.com> on 2010/07/05 23:50:52 UTC

Problem locking a node

Hi,

i'm trying to lock a node for 30 minutes

lockManager.lock(node.getPath(), false, false, 1800, username);
session.save();
session.logout();

there's no exception
but the node doesn't get locked.


any tip ?


-- 
Jose Hernandez
675599600
Isthari
http://www.isthari.com

Re: Problem locking a node

Posted by JOSE FELIX HERNANDEZ BARRIO <jo...@isthari.com>.
More info,

if i set the timeout to 0, the node is locked nicely,

*is there an issue on the timeout mechanism ???*




2010/7/6 JOSE FELIX HERNANDEZ BARRIO <jo...@isthari.com>

> still debuging this issue,
>
> if i execute the code :
>   lock = manager.lock(node.getPath(), true, false, 100000000, "admin");
>   System.out.println(lock.getLockToken());
>
>             while (true){
>
>
> System.out.println(manager.isLocked(node.getPath())+"\t"+lock.getSecondsRemaining());
>
>                 Thread.sleep(1000);
>             }
>
> the output:
> 91310ee2-3177-4616-9fee-5b0d80d76e30-T
> true    100000000
> false    -1
> false    -1
> false    -1
> false    -1
> false    -1
>
> the node is locked only for a second !!
>
>
>
>
> 2010/7/6 JOSE FELIX HERNANDEZ BARRIO <jo...@isthari.com>
>
> Hi,
>>
>> later i reopen a session get the same node a call
>> node.isLocked ();
>>
>> and this return false
>> if i call node.getProperty("jcr:lockOwner"); returns void
>>
>>
>>
>>
>> 2010/7/6 Jukka Zitting <ju...@gmail.com>
>>
>> Hi,
>>>
>>> On Tue, Jul 6, 2010 at 12:50 AM, JOSE FELIX HERNANDEZ BARRIO
>>> <jo...@isthari.com> wrote:
>>> > i'm trying to lock a node for 30 minutes
>>> >
>>> > lockManager.lock(node.getPath(), false, false, 1800, username);
>>> > session.save();
>>> > session.logout();
>>> >
>>> > there's no exception
>>> > but the node doesn't get locked.
>>>
>>> How do you determine whether the node is locked or not? I.e. what line
>>> of your code is giving results that you didn't expect seeing?
>>>
>>> BR,
>>>
>>> Jukka Zitting
>>>
>>
>>
>>
>> --
>> Jose Hernandez
>> 675599600
>> Isthari
>> http://www.isthari.com
>>
>
>
>
> --
> Jose Hernandez
> 675599600
> Isthari
> http://www.isthari.com
>



-- 
Jose Hernandez
675599600
Isthari
http://www.isthari.com

Re: Problem locking a node

Posted by JOSE FELIX HERNANDEZ BARRIO <jo...@isthari.com>.
still debuging this issue,

if i execute the code :
  lock = manager.lock(node.getPath(), true, false, 100000000, "admin");
  System.out.println(lock.getLockToken());

            while (true){


System.out.println(manager.isLocked(node.getPath())+"\t"+lock.getSecondsRemaining());

                Thread.sleep(1000);
            }

the output:
91310ee2-3177-4616-9fee-5b0d80d76e30-T
true    100000000
false    -1
false    -1
false    -1
false    -1
false    -1

the node is locked only for a second !!




2010/7/6 JOSE FELIX HERNANDEZ BARRIO <jo...@isthari.com>

> Hi,
>
> later i reopen a session get the same node a call
> node.isLocked ();
>
> and this return false
> if i call node.getProperty("jcr:lockOwner"); returns void
>
>
>
>
> 2010/7/6 Jukka Zitting <ju...@gmail.com>
>
> Hi,
>>
>> On Tue, Jul 6, 2010 at 12:50 AM, JOSE FELIX HERNANDEZ BARRIO
>> <jo...@isthari.com> wrote:
>> > i'm trying to lock a node for 30 minutes
>> >
>> > lockManager.lock(node.getPath(), false, false, 1800, username);
>> > session.save();
>> > session.logout();
>> >
>> > there's no exception
>> > but the node doesn't get locked.
>>
>> How do you determine whether the node is locked or not? I.e. what line
>> of your code is giving results that you didn't expect seeing?
>>
>> BR,
>>
>> Jukka Zitting
>>
>
>
>
> --
> Jose Hernandez
> 675599600
> Isthari
> http://www.isthari.com
>



-- 
Jose Hernandez
675599600
Isthari
http://www.isthari.com

Re: Problem locking a node

Posted by JOSE FELIX HERNANDEZ BARRIO <jo...@isthari.com>.
Hi,

later i reopen a session get the same node a call
node.isLocked ();

and this return false
if i call node.getProperty("jcr:lockOwner"); returns void




2010/7/6 Jukka Zitting <ju...@gmail.com>

> Hi,
>
> On Tue, Jul 6, 2010 at 12:50 AM, JOSE FELIX HERNANDEZ BARRIO
> <jo...@isthari.com> wrote:
> > i'm trying to lock a node for 30 minutes
> >
> > lockManager.lock(node.getPath(), false, false, 1800, username);
> > session.save();
> > session.logout();
> >
> > there's no exception
> > but the node doesn't get locked.
>
> How do you determine whether the node is locked or not? I.e. what line
> of your code is giving results that you didn't expect seeing?
>
> BR,
>
> Jukka Zitting
>



-- 
Jose Hernandez
675599600
Isthari
http://www.isthari.com

Re: Problem locking a node

Posted by Jukka Zitting <ju...@gmail.com>.
Hi,

On Tue, Jul 6, 2010 at 12:50 AM, JOSE FELIX HERNANDEZ BARRIO
<jo...@isthari.com> wrote:
> i'm trying to lock a node for 30 minutes
>
> lockManager.lock(node.getPath(), false, false, 1800, username);
> session.save();
> session.logout();
>
> there's no exception
> but the node doesn't get locked.

How do you determine whether the node is locked or not? I.e. what line
of your code is giving results that you didn't expect seeing?

BR,

Jukka Zitting