-
Oct 5th, 2012, 11:50 AM
#1
Not getting skipCount from stepExecution even if there are skipped records
I have step with reader,processor and writer with skippable exception FlatFileParseException and commit interval.
In reader's read method, I am expecting stepExecution to give me skipped count until now. The lines are getting skipped because of formatting issues and not able to map data type of the entity.
I tried,
stepExecution.getReadSkipCount();
stepExecution.getSkipCount();
I am hoping spring batch to increment these counts if I have configured skippable exception in job.
Thanks
-
Oct 8th, 2012, 11:55 AM
#2
Any replies experts ?
We want to determine the line number of the file being read, we are getting read count but readSkipCount is always zero !
We see that skipCount is updated in FaultTolerantChunkProvider class in "read" method using "contribution.incrementSkipCount() but contribution is not applied to stepExecution until transaction is committed.
To determine the line number we are using method stepExecution.getReadCount() + stepExecution.getReadSkipCount().
Is this the right way to determine line number ? Please let me know if there is any other way.
-
Oct 10th, 2012, 09:40 AM
#3
That's going to be the best bet. You are correct in your analysis. The read count is incremented as items are returned from the read method on the ItemReader. However if a row is skipped, the read skip count is incremented and the read count is not so the addition of the two would work on the initial run. The only concern would be on restarts. The previous skips are not included in the response of the getReadSkipCount. However, they are in the getStepSkipCount.
-
Oct 10th, 2012, 01:23 PM
#4
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules