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


##########
fineract-provider/src/main/java/org/apache/fineract/cob/loan/ApplyLoanLockTasklet.java:
##########
@@ -41,13 +43,43 @@
 @RequiredArgsConstructor
 public class ApplyLoanLockTasklet implements Tasklet {
 
+    private static final int NUMBER_OF_RETRIES = 3;
     private final FineractProperties fineractProperties;
     private final LoanLockingService loanLockingService;
     private final RetrieveLoanIdService retrieveLoanIdService;
     private final CustomJobParameterResolver customJobParameterResolver;
 
     @Override
     public RepeatStatus execute(@NotNull StepContribution contribution, 
@NotNull ChunkContext chunkContext) throws Exception {
+        // TODO: Need to check Spring Batch based retry logic in the future, 
with using RepeatStatus.CONTINUABLE to
+        // retry tasklet execution rather than do while. Currently with 
RepeatStatus.CONTINUABLE we are getting
+        // transaction rollback exception.
+        int numberOfExecutions = 0;
+        do {
+            try {
+                applyLoanLock(contribution);
+                return RepeatStatus.FINISHED;

Review Comment:
   I was wondering on this and i think we can try the following:
   - start a new transaction for the `loanLockingService.applyLock()` method
   - when there is an error set repeatStatus.CONTINUABLE
   - for counter we might wanna use stepExecution commit count (with every run 
it got increased)
   
   What do you think?



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