In ANSI mode, transactions are always implicitly started and explicitly closed.
A transaction initiates when one of the following happens:
- The first SQL request in a session executes
- The first request following the close of a previous transaction executes
The COMMIT or ROLLBACK/ABORT statements close a transaction.
If a transaction includes a DDL statement (including DATABASE and SET SESSION, which are considered DDL statements in this context), it must be the last statement in the transaction other than the transaction closing statement.
If an error is found in a request, then that request is aborted. Normally, the entire transaction is not aborted; however, some failures will abort the entire transaction. Locks placed by erroneous statements are not released.
Sessions in ANSI mode do not support BEGIN TRANSACTION/END TRANSACTION statements.