Skip to content

Commit 85a84cb

Browse files
hpoettkerfmbenhassine
authored andcommitted
Check dirty flag of step execution context before update in inner loop
1 parent fce780f commit 85a84cb

File tree

1 file changed

+3
-1
lines changed
  • spring-batch-core/src/main/java/org/springframework/batch/core/step/tasklet

1 file changed

+3
-1
lines changed

Diff for: spring-batch-core/src/main/java/org/springframework/batch/core/step/tasklet/TaskletStep.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,9 @@ public RepeatStatus doInTransaction(TransactionStatus status) {
430430
try {
431431
// Going to attempt a commit. If it fails this flag will
432432
// stay false and we can use that later.
433-
getJobRepository().updateExecutionContext(stepExecution);
433+
if (stepExecution.getExecutionContext().isDirty()) {
434+
getJobRepository().updateExecutionContext(stepExecution);
435+
}
434436
stepExecution.incrementCommitCount();
435437
if (logger.isDebugEnabled()) {
436438
logger.debug("Saving step execution before commit: " + stepExecution);

0 commit comments

Comments
 (0)