May 6th, 2011, 08:38 AM
DB Item Writer Exceptions
I am trying to write a simple batch job that reads from a flat file and writes the data to database tables. I have the job running properly when everything goes smoothly.
My issue is that if I get an exception writing a single record, such as a duplicate record, to a database the entire job fails. Can anyone tell me how to log failed record and continue processing the remaining data from the file?
Last edited by frank12345; May 6th, 2011 at 03:05 PM.
May 9th, 2011, 05:00 AM
May 10th, 2011, 04:20 PM
I would write an aspect to take the entire list of records with the problem, and try to insert them 1 by 1 until you get to the bad record. Then either throw out that 1 record, or handle it in some way.