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

Using Node.save() after changing descendants of shareable nodes can lead to not all changes being saved

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Blocker
    • 3.0.0.Beta4
    • 3.0.0.Alpha6
    • JCR
    • Workaround Exists
    • Hide

      Use Session.save() instead of the now-deprecated Node.save(), or call Node.save() at an ancestor of all changes.

      Show
      Use Session.save() instead of the now-deprecated Node.save() , or call Node.save() at an ancestor of all changes.

    Description

      Consider the case where a node N1 is shared to another node N2, and where a session is used to change the descendants of N1, but then Node.save() is called on one of the ancestors of N2. In this case, the save operation does not
      save the changes to the descendants of N1. Of course, the changes are still in the transient state of the session and will be saved upon the next Session.save() (so no information is lost nor is the persisted state corrupted in any way). For details, see the testModifyDescendantAndSave() and testModifyDescendantAndRemoveShareAndSave() tests in the ShareableNodeTest in the TCK.

      Note that Node.save() has been deprecated in JCR 2.0, so the workaround is to simply call Session.save().

      Attachments

        Issue Links

          Activity

            People

              rhauch Randall Hauch (Inactive)
              rhauch Randall Hauch (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: