Hello,
I have a question about batch parallelism and transaction scope. Is it possible to commit the changes made in a batch job with multiple asynchronous tasks only if there are no errors in any of the tasks and roll all changes back by the batch job run if any of the tasks contained an error?
For context, my company has a weekly batch job that performs posting of approx.400 project hours journals sequentially. This process is taking a long time and so I've created a proof of concept using the top picking technique described here:
https://learn.microsoft.com/en-us/archive/blogs/axperf/batch-parallelism-in-ax-part-iii
This is working great, I've cut the processing time significantly but my company has a requirement that if any error occurs on any of the journals, they would like all of the postings that occurred during the batch to roll back. This was easy when it was one big sequential process. Now that I've implemented this with multiple batch tasks, each journal is posting and committing individually and if there is an error, only that one journal fails to post and the rest are left posted.
I wasn't sure if there is a change to the way I am creating the batch tasks that would indicate to fail and roll back the entire batch job?