I am working on a batch system. I read that the batch gets fragmented into chunks, each chunk is a subset of an entire query; the chunks will be executed sequentially.


If one of the chunks fails, is there any way I can rollback all changes done in the chunks?


No. Once an execute method finishes successfully, the commit becomes permanent and can no longer be rolled back. You would have to execute another batch and undo whatever your first batch did, which may or may not be possible.

Not the answer you're looking for? Browse other questions tagged or ask your own question.