awaneetdecoder commented on code in PR #5671:
URL: https://github.com/apache/fineract/pull/5671#discussion_r3028797401


##########
fineract-savings/src/main/java/org/apache/fineract/portfolio/savings/service/SavingsSchedularInterestPoster.java:
##########
@@ -67,16 +70,10 @@ public class SavingsSchedularInterestPoster {
     public void postInterest() throws JobExecutionException {
         if (!savingAccounts.isEmpty()) {
             List<Throwable> errors = new ArrayList<>();
-            LocalDate yesterday = 
DateUtils.getBusinessLocalDate().minusDays(1);
             for (SavingsAccountData savingsAccountData : savingAccounts) {
                 boolean postInterestAsOn = false;
                 LocalDate transactionDate = null;
                 try {
-                    if (isInterestAlreadyPostedForPeriod(savingsAccountData, 
yesterday)) {

Review Comment:
   @adamsaghy The pre-check was removed because it is not thread-safe under 
concurrent execution — two job instances can both pass the check before either 
commits, then both proceed to post. The optimistic lock (WHERE id=? AND 
version=?) in batchQueryForSavingsSummaryUpdate is the reliable guard. Happy to 
restore it as an additional early-exit optimization if you prefer, since it 
would reduce unnecessary processing in the non-concurrent case.



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