Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-22286

Prevent document removal if a live proxy still exists

    XMLWordPrintable

    Details

      Description

      The removal of a document should be prevented if a live proxy pointing to it still exists.

      This is similar to the prevention of removal for a version if a proxy pointing to it still exists, except that for live documents there are more removal cases to consider, due to cascading removals inside folders.

      If a document is incorrectly removed while a proxy to it still exists, in the current codebase with VCS the next access to the proxy will throw:

      java.lang.NullPointerException
          at org.nuxeo.ecm.core.storage.sql.coremodel.SQLSession.newDocument(SQLSession.java:459)
          at org.nuxeo.ecm.core.storage.sql.coremodel.SQLSession.newDocument(SQLSession.java:441)
          at org.nuxeo.ecm.core.storage.sql.coremodel.SQLSession.getChildren(SQLSession.java:550)
          at org.nuxeo.ecm.core.storage.sql.coremodel.SQLDocumentLive.getChildren(SQLDocumentLive.java:528)
      

      If an attempt is made to remove a live document while a proxy still points to it, a DocumentExistsException "Cannot remove <folderid>, subdocument <livedocid> is the target of proxy <proxyid>" is thrown (this was already the case for a direct removal, but is now generalized even if the document is in a deep folder hierarchy).

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: