jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas Mueller (JIRA)" <j...@apache.org>
Subject [jira] Assigned: (JCR-2809) Lock expires almost immediately
Date Thu, 11 Nov 2010 08:17:14 GMT

     [ https://issues.apache.org/jira/browse/JCR-2809?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Thomas Mueller reassigned JCR-2809:
-----------------------------------

    Assignee: Thomas Mueller

> Lock expires almost immediately
> -------------------------------
>
>                 Key: JCR-2809
>                 URL: https://issues.apache.org/jira/browse/JCR-2809
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: locks
>    Affects Versions: 2.1.2
>            Reporter: Dominique Pfister
>            Assignee: Thomas Mueller
>
> When a timeoutHint other than Long.MAX_VALUE is given to the javax.jcr.lock.LockManager
API:
>    lock(String absPath, boolean isDeep, boolean isSessionScoped, long timeoutHint, String
ownerInfo)
> a timeoutTime in seconds will be computed as follows (o.a.j.core.lock.LockInfo#updateTimeoutTime):
>    long now = (System.currentTimeMillis() + 999) / 1000; // round up
>    this.timeoutTime = now + timeoutHint;
> the TimeoutHandler in o.a.j.core.lock.LockManagerImpl running every second will then
check whether the timeout has expired (o.a.j.core.lock.LockInfo#isExpired):
>     public boolean isExpired() {
>         return timeoutTime != Long.MAX_VALUE
>             && timeoutTime * 1000 > System.currentTimeMillis();
>     }
> Obviously, the latter condition is true from the very beginning. Replacing '>' with
'<' or '<=' should do the trick.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message