If the connection is disconnected before reaching the COMMIT
, happens a ROLLBACK
automatic.
Documentation:
With START TRANSACTION, autocommit remains disabled until you end the transaction with COMMIT or ROLLBACK. The autocommit mode then reverts to its Previous state.
After Disabling autocommit mode by Setting the autocommit variable to zero, changes to transaction-safe Tables (such as those for Innodb or NDB) are not made Permanent immediately. You must use COMMIT to store your changes to disk or ROLLBACK to ignore the changes.
Basically, when you start a transaction the flag autocommit
is unchecked. While remaining unchecked, changes are not persisted until a COMMIT
. If the link falls, the changes have never been persisted - and therefore have no effect.