Skip to content

Commit 36068b5

Browse files
committed
Persist job execution status before calling listeners
Related to #4362
1 parent db6ef7b commit 36068b5

File tree

1 file changed

+3
-0
lines changed
  • spring-batch-core/src/main/java/org/springframework/batch/core/job

1 file changed

+3
-0
lines changed

spring-batch-core/src/main/java/org/springframework/batch/core/job/AbstractJob.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,9 @@ public final void execute(JobExecution execution) throws JobInterruptedException
346346
jobExecutionEvent.commit();
347347
execution.setEndTime(LocalDateTime.now());
348348

349+
// save status in job repository before calling listeners
350+
jobRepository.update(execution);
351+
349352
try {
350353
listener.afterJob(execution);
351354
}

0 commit comments

Comments
 (0)