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

Update node.remove implementation to handle JCR validations

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Blocker
    • 3.0.0.Alpha5
    • 3.0.0.Alpha1, 3.0.0.Alpha2, 3.0.0.Alpha3
    • None
    • None

    Description

      The current node.remove implementation doesn't support some JCR required validations. To name a few:

      • removing mandatory nodes should throw ConstraintViolationException
      • removing a node already deleted in another session should throw InvalidItemStateException on save

      All of these are "exposed" when running the tck tests.

      Implementation notes:

      Due to the way the cache is changed on remove, imo we have a major problem when working with a couple of sessions (single threaded) and removing a node from one of them which is referenced in the other prior to the removal. When the session which removes the node is saved, that node is removed from the document and the workspace cache, which makes it impossible for the other session (which now has a "stale node") to do anything with it because it won't find it anymore. I've added a TODO in the part of the code where this should be handled.

      The above mentioned problem, causes all sorts of weird side effects: e.g. the path of the node cannot be correctly determined (because its parent can't be determined) and defaults to the root path.

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: