You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Nick Tuckett (JIRA)" <ji...@apache.org> on 2012/10/09 12:26:02 UTC

[jira] [Created] (JCR-3438) Lock tokens acquired inside a transaction do not get released when session logs out

Nick Tuckett created JCR-3438:
---------------------------------

             Summary: 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 out.

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

[jira] [Updated] (JCR-3438) Lock tokens acquired inside a transaction do not get released when session logs out

Posted by "Nick Tuckett (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-3438?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Nick Tuckett updated JCR-3438:
------------------------------

    Attachment: LockTokenTransactionTest.java

Test that reproduces the issue.
                
> 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 out.
> 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

[jira] [Commented] (JCR-3438) Lock tokens acquired inside a transaction do not get released when session logs out

Posted by "Claus Köll (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-3438?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13473205#comment-13473205 ] 

Claus Köll commented on JCR-3438:
---------------------------------

Ok i see but i think your testcase don't reflect the real world. What do you mean with UserTransaction ? 
                
> 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 out.
> 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

[jira] [Commented] (JCR-3438) Lock tokens acquired inside a transaction do not get released when session logs out

Posted by "Nick Tuckett (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-3438?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13473215#comment-13473215 ] 

Nick Tuckett commented on JCR-3438:
-----------------------------------

By UserTransaction I mean an equivalent of UserTransactionImpl.

And as for "real world", this is very definitely a real world application! It may be that we're abusing Jackrabbit/JCR support for XA, however...
                
> 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 out.
> 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

[jira] [Updated] (JCR-3438) Lock tokens acquired inside a transaction do not get released when session logs out

Posted by "Nick Tuckett (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-3438?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Nick Tuckett updated JCR-3438:
------------------------------

    Attachment: LockTokenTransactionTest.java
    
> 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 out.
> 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

[jira] [Commented] (JCR-3438) Lock tokens acquired inside a transaction do not get released when session logs out

Posted by "Claus Köll (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-3438?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13473179#comment-13473179 ] 

Claus Köll commented on JCR-3438:
---------------------------------

Hi Nick. I think you should not mix a xa and a normal call. Normally in XA Environment you can not close a session. A Session is wrapped within a JCASessionHandle.
The XA Container will close your Session when he closes the JCAManagedConnection.
Please have a look at XATest.java There we have several testcases about locking in xa environment.
                
> 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 out.
> 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

[jira] [Commented] (JCR-3438) Lock tokens acquired inside a transaction do not get released when session logs out

Posted by "Claus Köll (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-3438?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13473275#comment-13473275 ] 

Claus Köll commented on JCR-3438:
---------------------------------

Maybe you will also have a look at [http://www.day.com/specs/jcr/2.0/17_Locking.html]. Can you please check your usecase if it really shows up a bug .. greets claus
                
> 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 out.
> 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

[jira] [Commented] (JCR-3438) Lock tokens acquired inside a transaction do not get released when session logs out

Posted by "Nick Tuckett (JIRA)" <ji...@apache.org>.
    [ 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 out.
> 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

[jira] [Commented] (JCR-3438) Lock tokens acquired inside a transaction do not get released when session logs out

Posted by "Claus Köll (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-3438?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13473227#comment-13473227 ] 

Claus Köll commented on JCR-3438:
---------------------------------

I think of course that you have a real world application. All that i wanted to say is that a container is more then just a Mockup Object like the UserTransaction in our testcases.
You can find in [http://jackrabbit.apache.org/concurrency-control.html] .. "Don't mix concurrent transactional and non-transactional writes to a single workspace"

Hmm i don't know if your testcase reflects a bug in jackrabbit ... i will take a look at it closer ...


                
> 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 out.
> 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

[jira] [Updated] (JCR-3438) Lock tokens acquired inside a transaction do not get released when session logs out

Posted by "Nick Tuckett (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-3438?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Nick Tuckett updated JCR-3438:
------------------------------

    Attachment:     (was: LockTokenTransactionTest.java)
    
> 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 out.
> 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

[jira] [Commented] (JCR-3438) Lock tokens acquired inside a transaction do not get released when session logs out

Posted by "Nick Tuckett (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-3438?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13473957#comment-13473957 ] 

Nick Tuckett commented on JCR-3438:
-----------------------------------

I've been through the documentation, and understand why mixing transactional and non-transactional operations can be problematic. I've updated my test case (attached) so that the principle operations are all inside transactions, but the issue still happens.

My reading of those docs doesn't suggest anything to contradict that this is a problem - there is no concurrency of operations in the test case, so it would be safe to mix transactional and non-transactional operations, and I can't see anything in JCR specification for locking that also says otherwise.
                
> 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 out.
> 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

[jira] [Commented] (JCR-3438) Lock tokens acquired inside a transaction do not get released when session logs out

Posted by "Nick Tuckett (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-3438?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13473262#comment-13473262 ] 

Nick Tuckett commented on JCR-3438:
-----------------------------------

Many thanks, Claus. I haven't seen the article you sent the link to... looks very useful, will read it with interest!
                
> 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 out.
> 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

[jira] [Commented] (JCR-3438) Lock tokens acquired inside a transaction do not get released when session logs out

Posted by "Nick Tuckett (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-3438?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13473213#comment-13473213 ] 

Nick Tuckett commented on JCR-3438:
-----------------------------------

I've had a look through XATest.java - thank you for bringing it to my attention, very helpful!

testAddRemoveLockToken, testAddLockTokenRemoveNode might show my issue as they use two transactions in two different sessions, but explicitly remove the lock token from the first session so avoids the issue (and don't log out the first session anyway).
                
> 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 out.
> 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

[jira] [Comment Edited] (JCR-3438) Lock tokens acquired inside a transaction do not get released when session logs out

Posted by "Nick Tuckett (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-3438?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13473215#comment-13473215 ] 

Nick Tuckett edited comment on JCR-3438 at 10/10/12 1:37 PM:
-------------------------------------------------------------

By UserTransaction I mean an equivalent of UserTransactionImpl.

And as for "real world", this is very definitely a real world application! To clarify, the test case does reflect the behaviour of our application across three sequential web service requests.

It may be that we're abusing Jackrabbit/JCR support for XA, however...
                
      was (Author: dozencrows):
    By UserTransaction I mean an equivalent of UserTransactionImpl.

And as for "real world", this is very definitely a real world application! It may be that we're abusing Jackrabbit/JCR support for XA, however...
                  
> 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 out.
> 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