The `COMMIT` for transaction B isn't actually a commit, its a save point I think. The whole thing isn't committed until the final outer transaction commits. That being the case I think one global batch that disregards nested transactions and only takes action on the final, outer transaction commit would be appropriate. `open_transactions` should tell you right?