An AST can happen only inside another transaction. Inside an existing transaction (call it T0), the user can decide to start a subtransaction. Then T0 is paused and pushed in an AST stack, and a new transaction (call it T1) is started.
At some point in the future the user can commit the subtransaction; after T1 is committed then T0 is popped from the AST stack and resumed.
The user can also decide to COMMIT the parent transaction T0, in which case T1 is committed, then T0 is popped from the AST stack and then committed.
All the transactions happen synchronously; at any time only one transaction can be active, while in the stack there are zero (or more) paused transactions in the stack.
All the possible combinations of COMMIT / ROLLBACK for T0 and T1 can happen;
for instance, it is possible to COMMIT T1 and ROLLBACK T0.
It is possible to nest subtransactions, up to a global resource limit (e.g. the AST stack size) which can be set on the server.