Skip to content

Commit 74520a5

Browse files
hpoettkerfmbenhassine
authored andcommitted
Check dirty flag of step execution context before update in inner loop
1 parent aa60824 commit 74520a5

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

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

+3-1
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,9 @@ public RepeatStatus doInTransaction(TransactionStatus status) {
425425
try {
426426
// Going to attempt a commit. If it fails this flag will
427427
// stay false and we can use that later.
428-
getJobRepository().updateExecutionContext(stepExecution);
428+
if (stepExecution.getExecutionContext().isDirty()) {
429+
getJobRepository().updateExecutionContext(stepExecution);
430+
}
429431
stepExecution.incrementCommitCount();
430432
if (logger.isDebugEnabled()) {
431433
logger.debug("Saving step execution before commit: " + stepExecution);

0 commit comments

Comments
 (0)