Four characteristics, handling
1, atomicity (atomicity): All operations after the start of the transaction, or all done, or all do not, it is impossible to stagnate in the middle. An error occurred during the execution of the transaction, and it was rolled back to the state before the transaction began, and all operations were as if they had not occurred. This means that the transaction is an indivisible whole, like the atoms that the chemistry has learned, and is the basic unit of the material composition.
2. Consistency (consistency): The integrity constraints of the database are not compromised before and after the transaction begins. For example, a to B transfer, not a deduction of money, B but did not receive.
3, Isolation (isolation): At the same time, only one transaction is allowed to request the same data, and different transactions do not interfere with each other. For example, a is taking money from a bank card, B cannot transfer to this card until the end of the process of taking money.
4. Persistence (Durability): After the transaction is complete, all updates to the database are saved to the database and cannot be rolled back.
Query method:
SELECT @ @tx_isolation;
Four levels
Transaction ISOLATION LEVEL |
Dirty Read |
Non-REPEATABLE READ |
Phantom reading |
READ UNCOMMITTED (read-uncommitted) |
Is |
Is |
Is |
Non-repeatable read (read-committed) |
Whether |
Is |
Is |
Repeatable Read (Repeatable-read) |
Whether |
Whether |
Is |
Serialization (Serializable) |
Whether |
Whether |
Whether |
MySQL things are isolated