I really love the speed of batch processing using array DML. Unfortunately, there is very little information available if the batch fails. I can get (from the connection component!) the error message that contains the details of the failure (e.g. "primary key violation", and the primary key information) but that is it. I have no idea of the index of the offending item in the array, or any other parameters for that record.
Is there some way to get more transparency?
Ideally, I would like to have an event like OnUpdateError that can collect all information and respond with a choice of actions, however I would settle for the index of the record that failed.
Batch DML error tracking
Re: Batch DML error tracking
As a rule, when executing batch operation on the database server, a single DML expression is executed. If there are any problems with processing any element of the parameter array, the database server returns only one error related to the execution of this expression. It makes impossible to detect the index of the array parameter element, the processing of which causes an error.