Check dirty flag of step execution context before update in inner loop

This commit is contained in:
Henning Poettker
2023-11-30 10:43:00 +01:00
committed by Mahmoud Ben Hassine
parent 893e83e0b5
commit 2fbdcd42a0

View File

@@ -431,7 +431,9 @@ public class TaskletStep extends AbstractStep {
try {
// Going to attempt a commit. If it fails this flag will
// stay false and we can use that later.
getJobRepository().updateExecutionContext(stepExecution);
if (stepExecution.getExecutionContext().isDirty()) {
getJobRepository().updateExecutionContext(stepExecution);
}
stepExecution.incrementCommitCount();
if (logger.isDebugEnabled()) {
logger.debug("Saving step execution before commit: " + stepExecution);