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

Invalid handling of bi-directional references: ReferentialIntegrityException

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Critical
    • 2.8.1.Final
    • 2.6.0.Final, 2.7.0.Final, 2.8.0.Final
    • None
    • None
    • Hide

      run attached test case, in my case, the problem already occurs in the first loop. In my application unit testing scenario, this seems to be less deterministic though that's why the test runs in a loop, to eventually produce the issue.

      Test case results with: Exception in thread "main" javax.jcr.ReferentialIntegrityException
      at org.modeshape.jcr.JcrSession.checkReferentialIntegrityOfChanges(JcrSession.java:1276)
      at org.modeshape.jcr.JcrSession.save(JcrSession.java:1311)
      at test.Main.run(Main.java:118)
      at test.Main.main(Main.java:47)

      Show
      run attached test case, in my case, the problem already occurs in the first loop. In my application unit testing scenario, this seems to be less deterministic though that's why the test runs in a loop, to eventually produce the issue. Test case results with: Exception in thread "main" javax.jcr.ReferentialIntegrityException at org.modeshape.jcr.JcrSession.checkReferentialIntegrityOfChanges(JcrSession.java:1276) at org.modeshape.jcr.JcrSession.save(JcrSession.java:1311) at test.Main.run(Main.java:118) at test.Main.main(Main.java:47)

    Description

      2 nodes are created, node 1 & 2. Then node 1 is set to reference node 2, and vice versa. Then the session is saved. Afterwards, node 1 is retrieved by it's uuid, all references to node 1 are searched and each reference (the 1 reference from node 2 to node 1) is removed. After this, node 1 is removed and the session is saved.

      If this is done, the test runs successfully.

      If we create a 3rd node at the very beginning, but avoid creating references from/to this node, we get a javax.jcr.ReferentialIntegrityException.
      Even if we create the 3rd node, but don't create a reference from node 2 to 1, the problem also can not be reproduced.

      Attachments

        Activity

          People

            hchiorean Horia Chiorean (Inactive)
            simon.g Simon Gunzenreiner (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: