Batch Updating error handling
Hi,
I have implemented batch updating in our application and it is working fine. I'm trying to find out if the following error handling procedure would be possible, and if so does anyone know how: -
If executing a batch fails (determined from the int array returned), then identify the failing statement, remove it from the batch, log the failing statement, and retry executing the batch with the removed statement.
Thanks in advance for any help you can provide.
Chris.
[502 byte] By [
cbridlea] at [2007-11-27 11:24:39]

# 1
I believe you already have a list of failed items in the returned int array. There is no need to rerun the batch job. Those that can be updated were updated, those that cant be updated are indicated in the int array.
Just report on which items in the array have zero for a value (failed to update). If your batch update is sorted (by the primary keys), then you know item 34 in the int array that failed is primary key xxxxxx. Therefore return not the int array, but an array of failed primary keys. As you build up your batch queries, store each primary key in an array so you can reference the int array to that primary key array.