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


##########
fineract-provider/src/main/java/org/apache/fineract/cob/service/InlineLoanCOBExecutorServiceImpl.java:
##########
@@ -218,8 +218,15 @@ private void lockLoanAccounts(List<Long> loanIds, 
LocalDate businessDate) {
             protected void doInTransactionWithoutResult(@NotNull 
TransactionStatus status) {
                 List<LoanAccountLock> loanAccountLocks = 
getLoanAccountLocks(loanIds, businessDate);
                 loanAccountLocks.forEach(loanAccountLock -> {
-                    
loanAccountLock.setNewLockOwner(LockOwner.LOAN_INLINE_COB_PROCESSING);
-                    loanAccountLockRepository.save(loanAccountLock);
+                    try {
+                        
loanAccountLock.setNewLockOwner(LockOwner.LOAN_INLINE_COB_PROCESSING);
+                        
loanAccountLockRepository.saveAndFlush(loanAccountLock);
+                    } catch (Exception e) {
+                        String message = "There is a hard lock on the loan 
account without any error, so it can't be overruled. Locked loan ID: %s"

Review Comment:
   This does not mean automatically this... i would rather go with a more 
generic error message...



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