私はSpring Batchを使用しており、を使用して実行されるタスクレットを作成しましたSimpleAsyncTaskExecutor. このステップでは、StepExecutionContextwith を取得しています
@BeforeStep
public void saveStepExecution(StepExecution stepExecution) {
this.stepExecution = stepExecution;
}
タスクレットの処理メソッドでは、コンテキストを更新しようとしています:
stepExecution.getExecutionContext().put("info", contextInfo);
ConcurrentModificationExceptionこれはの につながりstepExecutionます。このマルチスレッド環境でこれらを回避し、コンテキストを更新するにはどうすればよいですか?