Uploaded image for project: 'ModeShape'
  1. ModeShape
  2. MODE-2654

Copy operation doesn't work well if copied elements are locked

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 5.4.0.Final
    • 5.1.0.Final, 5.2.0.Final, 5.3.0.Final
    • JCR
    • None
    • Hide

      1) Start transaction
      2) Create parent node
      3) Add child node to parent and add mixin "mix:lockable" to child node
      4) Commit transaction
      5) Start new transaction and new session
      6) Lock child node
      7) Copy parent node to new location
      8) Commit transaction
      9) Start new transaction and new session
      10)
      if you try to unlock new copy of child node, you will get exception

      javax.jcr.lock.LockException: The node at location '/newPath/child' is not locked
      
      	at org.modeshape.jcr.RepositoryLockManager.unlock(RepositoryLockManager.java:445)
      	at org.modeshape.jcr.JcrLockManager.unlock(JcrLockManager.java:305)
      	at org.modeshape.jcr.JcrLockManager.unlock(JcrLockManager.java:283) 
      

      If you try to lock new copy of child node, you will get exception:

      javax.jcr.lock.LockException: The node at '/newPath/child' is already locked
      
      	at org.modeshape.jcr.RepositoryLockManager.lock(RepositoryLockManager.java:392)
      	at org.modeshape.jcr.JcrLockManager.lock(JcrLockManager.java:273)
      	at org.modeshape.jcr.JcrLockManager.lock(JcrLockManager.java:237) 
      
      Show
      1) Start transaction 2) Create parent node 3) Add child node to parent and add mixin "mix:lockable" to child node 4) Commit transaction 5) Start new transaction and new session 6) Lock child node 7) Copy parent node to new location 8) Commit transaction 9) Start new transaction and new session 10) if you try to unlock new copy of child node, you will get exception javax.jcr.lock.LockException: The node at location '/newPath/child' is not locked at org.modeshape.jcr.RepositoryLockManager.unlock(RepositoryLockManager.java:445) at org.modeshape.jcr.JcrLockManager.unlock(JcrLockManager.java:305) at org.modeshape.jcr.JcrLockManager.unlock(JcrLockManager.java:283) If you try to lock new copy of child node, you will get exception: javax.jcr.lock.LockException: The node at '/newPath/child' is already locked at org.modeshape.jcr.RepositoryLockManager.lock(RepositoryLockManager.java:392) at org.modeshape.jcr.JcrLockManager.lock(JcrLockManager.java:273) at org.modeshape.jcr.JcrLockManager.lock(JcrLockManager.java:237)

    Description

      When you have a parent node with locked child node and then you copy parent node, you will be not able to lock or unlock new copy of child node.

      I was able to reproduce this defect with unit tests. Please find them in the attachments.

      Attachments

        Activity

          People

            hchiorean Horia Chiorean (Inactive)
            hot_jira Ostap Shtabura (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: