adamsaghy commented on code in PR #3589:
URL: https://github.com/apache/fineract/pull/3589#discussion_r1398811637


##########
fineract-core/src/main/java/org/apache/fineract/commands/service/SynchronousCommandProcessingService.java:
##########
@@ -103,32 +102,30 @@ public CommandProcessingResult executeCommand(final 
CommandWrapper wrapper, fina
         }
         exceptionWhenTheRequestAlreadyProcessed(wrapper, idempotencyKey, 
isRetry);
 
-        boolean sameTransaction = 
BatchRequestContextHolder.getEnclosingTransaction().isPresent();
         if (commandSource == null) {
             AppUser user = context.authenticatedUser(wrapper);
-            commandSource = sameTransaction ? 
commandSourceService.saveInitialSameTransaction(wrapper, command, user, 
idempotencyKey)
-                    : commandSourceService.saveInitialNewTransaction(wrapper, 
command, user, idempotencyKey);
-            storeCommandIdInContext(commandSource); // Store command id as a 
request attribute
+            commandSource = 
commandSourceService.getInitialCommandSource(wrapper, command, user, 
idempotencyKey);

Review Comment:
   This looks not correct. If we are not storing in the DB a command processing 
was started, there is absolutely no defense to start processing the same 
command multiple times. Am I missing something?



-- 
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