jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nick Tuckett (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (JCR-3438) Lock tokens acquired inside a transaction do not get released when session logs out
Date Wed, 10 Oct 2012 13:01:09 GMT

    [ https://issues.apache.org/jira/browse/JCR-3438?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13473201#comment-13473201

Nick Tuckett commented on JCR-3438:

Hi Claus!

I think the problem still stands for my situation - my application presents web services that
use Jackrabbit as a back end; and to keep things as stateless as possible we use a new session
on each web service request. We use open scoped locks to ensure mutually exclusive changes
to the database content across multiple requests, and we use UserTransaction to wrap multiple
related Jackrabbit writes required by some requests to ensure data integrity in case of an
error during the request. We don't use "true" XA, i.e. through JCA. In this situation, we
have control over the session lifetime ourselves, and may or may not use a transaction inside
that lifetime. 

> Lock tokens acquired inside a transaction do not get released when session logs out
> -----------------------------------------------------------------------------------
>                 Key: JCR-3438
>                 URL: https://issues.apache.org/jira/browse/JCR-3438
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-core
>    Affects Versions: 2.4.2
>            Reporter: Nick Tuckett
>         Attachments: LockTokenTransactionTest.java
> When outside a transaction, LockManager.addLockToken() calls org.apache.jackrabbit.core.lock.LockManagerImpl.addLockToken().
This sets the lock holder, and if the LockInfo object is actually an InternalLockInfo object,
it adds that object as a session listener. This means that the LockInfo object is notified
when the session is logging out, whereupon it causes the session to release the lock token.
> When adding a lock token inside a transaction, the underlying implementation calls org.apache.jackrabbit.core.lock.XAEnvironment.addLockToken().
This sets the lock holder on the LockInfo object but does not add it as a session listener.
Consequently the lock token remains owned by the session, even when the session finishes logging
> Subsequent attempts to get the lock token in other sessions using the same credentials
then fail.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

View raw message