Results 1 to 5 of 5

Thread: validation error details to a database

  1. #1

    Unhappy validation error details to a database

    Hello

    I am trying to use spring batch but the documentation is terrible.
    What I need to do is to validate a fixed length input file completelly and write errors to a database (error description, line of the input where occurred).
    I don't need to write the input data to the database now. What I need to do is generate an error report to be sent to our customers so they can resend us the input file corrected.

    I saw already that I can use exceptionHandler so I can process the whole file skipping the errors. That is working fine. The problem now is how to determine where these errors occurred (which line and the error detail) and where and how to write them to the database.

    any code example would be of much help

    thanks.

  2. #2
    Join Date
    Dec 2006
    Posts
    1,061

    Default

    Apologies on the incomplete documentation, I actually took a break from working on them to check the forums. Which version of the framework are you using? M5?

  3. #3

    Default

    m4.. I will try to do tests on m5 tomorrow.

  4. #4
    Join Date
    Dec 2006
    Posts
    1,061

    Default

    M5 should make things a little easier to understand, since you can use an ItemReadListener to catch exceptions, which is bit more explicit than using the ExceptionHandler. The FlatFileItemReader throws a FlatFileParsingException, from which you can get the original line of input.

  5. #5

    Default

    please, can you provide an example step that uses ItemReadListener to catch exceptions ?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •