15.16.1. Transaction Overview
Transactions are not explicitly started on the storage engine
level, but are instead implicitly started through calls to
either start_stmt()
or
external_lock()
. If the preceding functions
are called and a transaction already exists the transaction is
not replaced.
The storage engine stores transaction information in
per-connection memory and also registers the transaction in the
MySQL server to allow the server to later issue
COMMIT
and ROLLBACK
operations.
As operations are performed the storage engine will have to
implement some form of versioning or logging to permit a
rollback of all operations executed within the transaction.
After work is completed, the MySQL server will call either the
commit()
function or the
rollback()
function defined in the storage
engine's handlerton.