Home >Database >Mysql Tutorial >Mysql advanced transactions
In layman’s terms, a transaction: refers to a set of operations that are either successfully executed or not executed at all.---->Atomicity
Before all operations are completed, other sessions cannot see the process of intermediate changes. -->Isolation
Before and after the transaction, the total amount of data still matches----->Consistency
The impact of the transaction cannot be undone------>Persistence
If an error is made, the transaction is not allowed to be undone, and can only be transferred through "compensatory transactions"
Li San: --->Expenditure 500, Li San -500
Zhao Si: --- ->Received 500, Zhao Si +500
About the transaction engine:
Select innodb/bdb
Start transaction: start transaction;
Sql....
Sql... ..
Commit Submit
rollback Rollback
Note: When a transaction commit, or rollback is over
Note: There are some statements that will cause the transaction to be implicitly committed, such as start transaction
A specific example of a transaction: