spring-projects / spring-batch-extensions

Spring Batch Extensions
242 stars 258 forks source link

Use reader current row count from failed execution to get correct row on restart #25

Closed scloutier closed 3 years ago

scloutier commented 8 years ago

I noticed when restarting jobs after failure, the AbstractExcelItemReader would begin reading from the first row in the spreadsheet. The doRead method is simply calling rowSet.next() and ignoring the AbstractItemCountingItemStreamItemReaders attempt to jump to the correct row. A solution that I found to work was to override the jumpToItem method in AbstractExcelItemReader and simply call rowSet.next until we have the correct row.

mdeinum commented 3 years ago

The jumpToItem method has been implemented akin the suggested solution here and inspired from the FlatFileItemReader from Spring Batch itself.

Closed with #65.