diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/job/AbstractJob.java b/spring-batch-core/src/main/java/org/springframework/batch/core/job/AbstractJob.java index d0c7de2ef..8e4b4b9c5 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/job/AbstractJob.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/job/AbstractJob.java @@ -125,6 +125,12 @@ public abstract class AbstractJob implements Job, BeanNameAware, InitializingBea return name; } + /** + * Boolean flag to prevent categorically a job from restarting, even if it + * has failed previously. + * + * @param restartable the value of the flag to set (default true) + */ public void setRestartable(boolean restartable) { this.restartable = restartable; } @@ -319,7 +325,7 @@ public abstract class AbstractJob implements Job, BeanNameAware, InitializingBea jobRepository.add(currentStepExecution); step.execute(currentStepExecution); - + jobRepository.updateExecutionContext(execution); if (currentStepExecution.getStatus() == BatchStatus.STOPPED