The query does not break ACID compliance. The rows/pages/table (depending on your database) are locked for the duration of the execution (or actually, until the outer-most COMMIT statement).
It's:
- Atomic: it's all or nothing at all,
- Consistent: when the transaction completes, all rows that used to have
id IN (3, 4) will have been removed.
- Isolated: once you lock the affected rows, they're not affected by other transactions (which will either block your transaction or wait for it to finish).
- Durable: Once committed, your delete is "hardened".
This query would be functionally the same if you removed BEGIN TRANSACTION T2 and COMMIT TRANSACTION T2.
The point of having a nested transaction like that is that you can roll back some of the work if you want to (for instance, if you find something went wrong with your initial update).