FINERACT-2181: Added threadlocal context reset during parallel accrual processing
This commit is contained in:
committed by
Arnold Gálovics
parent
961e6d1aa6
commit
134b097a5e
+4
@@ -161,6 +161,7 @@ public class LoanAccrualsProcessingServiceImpl implements LoanAccrualsProcessing
|
||||
|
||||
loans.forEach(outerLoan -> {
|
||||
loanTasks.add(taskExecutor.submit(() -> {
|
||||
try {
|
||||
ThreadLocalContextUtil.init(context);
|
||||
transactionTemplate.executeWithoutResult(status -> {
|
||||
Loan loan = loanRepositoryWrapper.findOneWithNotFoundDetection(outerLoan.getId());
|
||||
@@ -174,6 +175,9 @@ public class LoanAccrualsProcessingServiceImpl implements LoanAccrualsProcessing
|
||||
throw new RuntimeException("Failed to add accrual for loan " + loan.getId(), e);
|
||||
}
|
||||
});
|
||||
} finally {
|
||||
ThreadLocalContextUtil.reset();
|
||||
}
|
||||
}));
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user