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

Transaction is marked for rollback when CoreSession#getParentDocument throws an exception

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.8.0-HF11, 5.9.3
    • Component/s: Core

      Description

      Typically in the following code from AbstractDocumentBackedFileSystemItem (nuxeo-drive addon):

      try {
                  parentDoc = docSession.getParentDocument(doc.getRef());
              } catch (DocumentSecurityException e) {
                  log.debug(String.format(
                          "User %s has no READ access on parent of document %s (%s), will throw RootlessItemException.",
                          principal.getName(), doc.getPathAsString(), doc.getId()));
              }
      

      If docSession.getParentDocument() throws a DocumentSecurityException then the transaction is marked for rollback, which should not be the case, especially in a case like that where we want to catch this exception.

      We should probably add @NoRollbackOnException to CoreSession#getParentDocument, and check if any other method would also need this annotation.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: