From c03cbf57134dda2f0ed743e5bff88fa491693863 Mon Sep 17 00:00:00 2001 From: Ralph Soika Date: Tue, 28 Jan 2020 13:20:33 +0100 Subject: [PATCH] fixed Issue #634 --- .../workflow/engine/DocumentService.java | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/imixs-workflow-engine/src/main/java/org/imixs/workflow/engine/DocumentService.java b/imixs-workflow-engine/src/main/java/org/imixs/workflow/engine/DocumentService.java index 543ab348e..9f59d723e 100644 --- a/imixs-workflow-engine/src/main/java/org/imixs/workflow/engine/DocumentService.java +++ b/imixs-workflow-engine/src/main/java/org/imixs/workflow/engine/DocumentService.java @@ -902,11 +902,16 @@ public List findDocumentsByRef(String uniqueIdRef, int pageSize, /** * Returns an unordered list of all documents of a specific type. The method * throws an InvalidAccessException in case no type attribute is defined. + *

+ * The Transactiontype REQUIRES_NEW ensure that during the processing lifecycle + * an external service call did not overwrite the current document jpa object + * (see Issue #634) * * @param type * @return * @throws InvalidAccessException */ + @TransactionAttribute(value = TransactionAttributeType.REQUIRES_NEW) public List getDocumentsByType(String type) { if (type == null || type.isEmpty()) { throw new InvalidAccessException(INVALID_PARAMETER, "undefined type attribute"); @@ -920,11 +925,16 @@ public List getDocumentsByType(String type) { /** * Returns all documents of by JPQL statement + *

+ * The Transactiontype REQUIRES_NEW ensure that during the processing lifecycle + * an external service call did not overwrite the current document jpa object + * (see Issue #634) * * @param query - JPQL statement * @return * */ + @TransactionAttribute(value = TransactionAttributeType.REQUIRES_NEW) public List getDocumentsByQuery(String query) { return getDocumentsByQuery(query, -1); @@ -932,24 +942,34 @@ public List getDocumentsByQuery(String query) { /** * Returns all documents of by JPQL statement. + *

+ * The Transactiontype REQUIRES_NEW ensure that during the processing lifecycle + * an external service call did not overwrite the current document jpa object + * (see Issue #634) * * @param query - JPQL statement * @param maxResult - maximum result set * @return * */ + @TransactionAttribute(value = TransactionAttributeType.REQUIRES_NEW) public List getDocumentsByQuery(String query, int maxResult) { return getDocumentsByQuery(query, 0, maxResult); } /** * Returns all documents of by JPQL statement. + *

+ * The Transactiontype REQUIRES_NEW ensure that during the processing lifecycle + * an external service call did not overwrite the current document jpa object + * (see Issue #634) * * @param query - JPQL statement * @param maxResult - maximum result set * @return * */ + @TransactionAttribute(value = TransactionAttributeType.REQUIRES_NEW) public List getDocumentsByQuery(String query, int firstResult, int maxResult) { boolean debug = logger.isLoggable(Level.FINE); List result = new ArrayList();