I don’t think this will work.
Simplest to me is just running this twice and if it errors the second time around bail out.
That said, it is not as trivial as “running twice”
- You run it the first time, catching errors on any particular setting you set
- Second time you just run it in a batch and bail out if anything fails
If we are already handling this mess we got to handle cases where there are multiple dependencies going on.
There is also the question of clean rollback, so this is not a trivial task at all.