]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
UCBG-444: Refresh nuxeo doc after update, so changes made by documentModifiedevent...
authorRichard Millet <remillet@gmail.com>
Thu, 6 Jun 2019 20:36:01 +0000 (13:36 -0700)
committerRichard Millet <remillet@gmail.com>
Thu, 6 Jun 2019 20:37:43 +0000 (13:37 -0700)
services/common/src/main/java/org/collectionspace/services/nuxeo/client/java/NuxeoRepositoryClientImpl.java

index 96056d2553d3b3082be9b4d6abe1543a4736b28d..72cb142b02321e953a51d792d63065accbb57535 100644 (file)
@@ -1608,6 +1608,9 @@ public class NuxeoRepositoryClientImpl implements RepositoryClient<PoxPayloadIn,
             handler.handle(Action.UPDATE, wrapDoc);
             repoSession.saveDocument(doc);
             repoSession.save();
+            // Refresh the doc after save, in case a documentModified event handler has modified
+            // the document post-save. We want those changes to be reflected in the returned document.
+            doc.refresh();
             handler.complete(Action.UPDATE, wrapDoc);
         } catch (BadRequestException bre) {
                rollbackTransaction(repoSession);