Uploaded image for project: 'Jackrabbit Content Repository'
  1. Jackrabbit Content Repository
  2. JCR-3698

Locking works incorrectly when used with JTA transactions.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.6.3
    • None
    • jackrabbit-core, locks
    • None
    • JDK 7, JTA 1.1

    Description

      When JTA is used, locking is performed inside the transaction the session is registered in. This makes locks visible only after transaction is commited and session-scoped locks are useless.

      Steps to reproduce:
      1. Add a node.
      1. Begin transaction.
      2. Create lock for node.
      3. Suspend transaction.
      4. Begin new transaction.
      5. Check for lock on node.
      Expected: node is locked.
      Actual result: node is not locked until first transaction is commited. If session-scoped lock is used, node will never be locked.

      Workaround that simulates session scoped lock:
      1. Suspend current transaction.
      2. Begin new transaction.
      3. Create lock.
      4. Commit.
      5. Resume suspended transaction.
      6. Assign lock to resumed transaction.
      7. Register Synchronization to release lock before transaction is finished.

      Attachments

        Activity

          People

            Unassigned Unassigned
            radeks Radoslaw Stachowiak
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: