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

Not possible to update parent node in one session and remove child node in another session within same transaction

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Blocker
    • 5.1.0.Final
    • 5.0.0.Final
    • JCR
    • None
    • Hide

      Preparation - create node ( parent ) and add child node to it
      1) Start transaction
      2) Create session
      3) update some property on parent node
      4) Save and close session
      5) Create second session
      6) Remove child node in the second session
      7) Try to save second session
      8) You will get exception

      I created a test that reproduces this issue (you can find it in the attachments), I reused TransactionsTest class from modeshape-jcr module and added my test.

      Show
      Preparation - create node ( parent ) and add child node to it 1) Start transaction 2) Create session 3) update some property on parent node 4) Save and close session 5) Create second session 6) Remove child node in the second session 7) Try to save second session 8) You will get exception I created a test that reproduces this issue (you can find it in the attachments), I reused TransactionsTest class from modeshape-jcr module and added my test.

    Description

      When you try to update parent node in one session and remove child node in another session within same transaction, you will get exception while saving second session.

      Exception:

      Caused by: javax.jcr.InvalidItemStateException: This session tried to save changes to node with key 'Cannot locate child node: c0812dd7505d645b6e581e-3081-4488-92d8-f8152c3646ee within parent: c0812dd7505d6410124ee4-50c3-4d7f-850b-be55cc2851e5', but it was removed by another session.
      	at org.modeshape.jcr.JcrSession.save(JcrSession.java:1171) 
      Caused by: org.modeshape.jcr.cache.NodeNotFoundInParentException: Cannot locate child node: c0812dd7505d645b6e581e-3081-4488-92d8-f8152c3646ee within parent: c0812dd7505d6410124ee4-50c3-4d7f-850b-be55cc2851e5
      	at org.modeshape.jcr.cache.document.LazyCachedNode.parentReferenceToSelf(LazyCachedNode.java:238)
      	at org.modeshape.jcr.cache.document.LazyCachedNode.getSegment(LazyCachedNode.java:282)
      	... 5 skipped due to configuration 
      

      Attachments

        Issue Links

          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: