I created a spring batch job by using FlatFileItemReader which reads data from a delimited file and then write to DB by using JdbcBatchItemWriter. And my setp configuration is like below.
<batch:step id="step1">
<batch:tasklet>
<batch:chunk reader="fileReader"
writer="dbWriter" commit-interval="100">
</batch:chunk>
</batch:tasklet>
</batch:step>
The configuration above is opening separate transactions for each 100rows, so if a failure occurs before completion of tasklet(step-1) then I can't revert the previously committed rows. Is there a way to run the entire tasklet in a single transaction?.
P.S: I am using MapJobRepositoryFactoryBean as job repository, don't want to create meta tables in database for restarting.