mariiaKraievska commented on code in PR #3555:
URL: https://github.com/apache/fineract/pull/3555#discussion_r1386700290


##########
fineract-core/src/main/java/org/apache/fineract/commands/service/SynchronousCommandProcessingService.java:
##########
@@ -139,7 +139,8 @@ public CommandProcessingResult executeCommand(final 
CommandWrapper wrapper, fina
             
commandSource.setCommandJson(toApiJsonSerializer.serializeResult(result.getChanges()));
         }
 
-        commandSource = 
commandSourceService.saveResultSameTransaction(commandSource);
+        commandSource = sameTransaction ? 
commandSourceService.saveResultSameTransaction(commandSource)
+                : commandSourceService.saveResultNewTransaction(commandSource);

Review Comment:
   I also tried to do as you described ("Тhe code that you should change is in 
the catch (Throwable t) branch: instead of saveResultSameTransaction for 
'sameTransaction' we should call 'saveResultNewTransaction' each time."). But 
with this approach, unsuccessful sub-requests are not logged to the audit trail 
:(



##########
fineract-core/src/main/java/org/apache/fineract/commands/service/SynchronousCommandProcessingService.java:
##########
@@ -139,7 +139,8 @@ public CommandProcessingResult executeCommand(final 
CommandWrapper wrapper, fina
             
commandSource.setCommandJson(toApiJsonSerializer.serializeResult(result.getChanges()));
         }
 
-        commandSource = 
commandSourceService.saveResultSameTransaction(commandSource);
+        commandSource = sameTransaction ? 
commandSourceService.saveResultSameTransaction(commandSource)
+                : commandSourceService.saveResultNewTransaction(commandSource);

Review Comment:
   I also tried to do as you described ("Тhe code that you should change is in 
the catch (Throwable t) branch: instead of saveResultSameTransaction for 
'sameTransaction' we should call 'saveResultNewTransaction' each time."). But 
with this approach, unsuccessful sub-requests are not logged to the audit trail 
:(



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to