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

ReferentialIntegrityException When Remove A Version

XMLWordPrintable

      When i remove a version it throws javax.jcr.ReferentialIntegrityException: org.modeshape.jcr.cache.ReferentialIntegrityException.
      I notice the version to removed is not the baseVersion, and its references are just processors and successors(I display them in the log). More log details: https://community.jboss.org/thread/236517

      After I dig code found code in WritableSessionCache(For example remove Node A's version V1):
      if (entry != null)

      { // The entry hasn't yet been removed by another (concurrent) session ... Document doc = documentStore.get(removedKey.toString()).getContentAsDocument(); referrers.addAll(translator.getReferrers(doc, ReferenceType.STRONG)); }

      When exception occures: The reference is the node A itself and the "doc" that will be removed is node "nt:version". But I'm sure A's base version is not V1?

      Is there any situation that node A still reference V1 which is not base version?

      When I add this line code before above code, it works fine, of cause I'm sure the deleted versions are not base version:

      if(workspaceCache.getNode(removedKey).getPrimaryType(this).compareTo(JcrNtLexicon.VERSION)==0)

      { continue; }

              hchiorean Horia Chiorean (Inactive)
              angelo.chen Angelo Chen (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: