From f34dfb976552bf566b5a540328ba1b7ef3869776 Mon Sep 17 00:00:00 2001 From: Arnold Galovics Date: Mon, 4 Sep 2023 11:04:31 +0200 Subject: [PATCH] FINERACT-1724: Made inline loan COB reader and processor job scoped to avoid state sharing --- .../java/org/apache/fineract/cob/loan/LoanInlineCOBConfig.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fineract-provider/src/main/java/org/apache/fineract/cob/loan/LoanInlineCOBConfig.java b/fineract-provider/src/main/java/org/apache/fineract/cob/loan/LoanInlineCOBConfig.java index d2e570cfc3b..343c074ed38 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/cob/loan/LoanInlineCOBConfig.java +++ b/fineract-provider/src/main/java/org/apache/fineract/cob/loan/LoanInlineCOBConfig.java @@ -30,6 +30,7 @@ import org.apache.fineract.portfolio.loanaccount.domain.LoanRepository; import org.springframework.batch.core.Job; import org.springframework.batch.core.Step; +import org.springframework.batch.core.configuration.annotation.JobScope; import org.springframework.batch.core.job.builder.JobBuilder; import org.springframework.batch.core.launch.support.RunIdIncrementer; import org.springframework.batch.core.listener.ExecutionContextPromotionListener; @@ -96,11 +97,13 @@ public Job loanInlineCOBJob() { .build(); } + @JobScope @Bean public InlineCOBLoanItemReader inlineCobWorkerItemReader() { return new InlineCOBLoanItemReader(loanRepository); } + @JobScope @Bean public InlineCOBLoanItemProcessor inlineCobWorkerItemProcessor() { return new InlineCOBLoanItemProcessor(cobBusinessStepService);