BATCH-1396: added step scope to retry and fixed bugs

This commit is contained in:
Dave Syer
2011-03-21 09:35:20 +00:00
parent aeadf8b02e
commit 58ad6bd542
12 changed files with 239 additions and 57 deletions

View File

@@ -9,10 +9,13 @@
<step id="playerload" next="gameLoad">
<tasklet>
<chunk reader="playerFileItemReader" writer="playerWriter" commit-interval="${job.commit.interval}"
skip-limit="#{jobParameters['skip.limit']}">
skip-limit="#{jobParameters['skip.limit']}" retry-limit="#{jobParameters['retry.limit']}">
<skippable-exception-classes>
<include class="org.springframework.dao.DataAccessException" />
</skippable-exception-classes>
<retryable-exception-classes>
<include class="org.springframework.dao.DataAccessException" />
</retryable-exception-classes>
</chunk>
</tasklet>
</step>

View File

@@ -89,7 +89,7 @@ public class FootballJobSkipIntegrationTests {
logger.info("Processed: " + stepExecution);
}
// They all skip on the second execution because of a primary key violation
execution = jobLauncher.run(job, new JobParametersBuilder().addLong("skip.limit", 100000L)
execution = jobLauncher.run(job, new JobParametersBuilder().addLong("skip.limit", 100000L).addLong("retry.limit", 2L)
.toJobParameters());
assertEquals(BatchStatus.COMPLETED, execution.getStatus());
for (StepExecution stepExecution : execution.getStepExecutions()) {