Figure 6-9. Stopping a job via Spring Batch Admin
When you click the Stop button, Spring Batch throws a JobInterruptedException , stopping the job.
It's important to note what happens here. With the way you have the job configured, the chunk that is
currently being processed when the Stop button is clicked is rolled back. When the job is restarted,
Spring Batch uses the previous job's various ExecutionContext s (job and step) to determine where it was
in the processing of step1 and restart where it left off. Figure 6-10 shows how the first time the job was
executed, 50 records were processed in step1 ; the second time the job was executed, the second 50
records were processed.
Figure 6-10. Results for two executions of transactionJob