Java Reference
In-Depth Information
Launcher.java:114)
at
org.springframework.batch.core.launch.support.CommandLineJobRunner.start(Comm
andLineJobRunner.java:348)
at
org.springframework.batch.core.launch.support.CommandLineJobRunner.main(Comma
ndLineJobRunner.java:565)
Caused by: org.springframework.batch.core.job.flow.FlowExecutionException:
Ended flow=transactionJob at state=transactionJob.step1 with exception
at
org.springframework.batch.core.job.flow.support.SimpleFlow.resume(SimpleFlow.
java:152)
at
org.springframework.batch.core.job.flow.support.SimpleFlow.start(SimpleFlow.j
ava:124)
at
org.springframework.batch.core.job.flow.FlowJob.doExecute(FlowJob.java:135)
... 6 more
Caused by: org.springframework.batch.core.StartLimitExceededException:
Maximum start limit exceeded for step: step1StartMax: 1
at
org.springframework.batch.core.job.SimpleStepHandler.shouldStart(SimpleStepHa
ndler.java:216)
at
org.springframework.batch.core.job.SimpleStepHandler.handleStep(SimpleStepHan
dler.java:117)
at
org.springframework.batch.core.job.flow.JobFlowExecutor.executeStep(JobFlowEx
ecutor.java:61)
at
org.springframework.batch.core.job.flow.support.state.StepState.handle(StepSt
ate.java:60)
at
org.springframework.batch.core.job.flow.support.SimpleFlow.resume(SimpleFlow.
java:144)
... 8 more
The last configuration aspect that you can use when determining what should happen when your
batch job is reexecuted, you've seen before: the allow-start-if-complete attribute.
Rerunning a Complete Step
One of Spring Batch's features (or detriments, depending on how you choose to look at it) is that the
framework allows you to execute a job only once successfully with the same parameters. There is no way
around this. However, that rule doesn't necessarily apply to steps.
You can override the framework's default configuration and execute a step that has been completed
more than once. You did it previously using transactionJob . To tell the framework that you want to be
able to reexecute a step even if it has been completed, you use the allow-start-if-complete attribute of
the tasklet. Listing 6-40 shows an example.
 
 
Search WWH ::




Custom Search