Announcement Announcement Module
Collapse
No announcement yet.
Getting hold of the Line Number in SkipListener Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Getting hold of the Line Number in SkipListener

    Hi,
    I am currently doing some validations in the ItemProcessor and i try to skip the record when the validation fails. At the same time i also have configured a SkipListener which needs to log this record to the tables so that it can be tracked and fixed later. One of the req is to know the line number so that it would be easy to trace the record the file. Hence i want to log the line number of this record as well. Is there a way to get hold of the line number in the onSkipInProcess() method of SkipListener. Initially i thought i would use the readCount of StepExecution, but i presume it will not yield proper results if the job restarts.

    Could somebody let me know the way to get hold of the line number in the onSkipInProcess() method for a ValidationException?

    Thanks in advance.

  • #2
    I think it's not so easy. As you you see your requirement is related mostly to flat file processing but other ItemReaders can not honor order of items (eg. database readers of unsorted data). So I suggest to identify item by some unique id instead of depends on line (which no make seans in general approach to ItemReaders).
    I know that maybe not so easy if you are not an owner of type spec
    HTH

    Comment

    Working...
    X