Uploaded image for project: 'Magnolia'
  1. Magnolia
  2. MAGNOLIA-7037

InvalidItemStateException can occur when trying to remove node with versions

    XMLWordPrintable

Details

    • Bug
    • Resolution: Workaround exists
    • Neutral
    • None
    • 5.5
    • None
    • None

    Description

      javax.jcr.InvalidItemStateException can sometimes occur when calling node.remove() (and most likely also when calling session.removeItem(absPath)).

      This happens when node has versions, and has pending changes (changes that weren't saved) before calling node.remove() (session.removeItem(absPath)). It's due to removing mixin mgnl:hasVersions from the original node. This call happens when whole version history for the original node is removed.
      Unfortunately removing the mixin happens in another session than removing the actual node - so using current (not system) session should resolve the issue.

      Workaround is easy : save node before removing it.

      Checklists

        Acceptance criteria

        Attachments

          Activity

            People

              Unassigned Unassigned
              jsimak Jaroslav Simak
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Checklists

                  Bug DoR
                  Task DoD