Mysql Transaction Processing
1. transactions are not dedicated to mysql
2. ACID properties of transactions
1) atomicity)
A transaction must be regarded as an inseparable minimum unit of work. All operations in the entire transaction are either committed successfully or rolled back. For a transaction, it is impossible to execute only one part of the transaction.
Operation, which is the atomicity of the transaction.
2) consistency)
The database always changes from a consistent state to another consistent state.
3) isolation)
Generally, modifications made by a firm are invisible to other transactions before the final commit.
4) durability)
Once a transaction is committed, the modifications made will be permanently saved to the database.
3. isolation level
1) read uncommitted (uncommitted read)
At this level, the transaction is modified. Even if it is not committed, it is visible to other transactions.
2) read committed (submit READ)
It is invisible to other transactions before committing
3) repeatable read (repeatable read) [mysql Default transaction isolation level]
This level ensures that the results of reading the same record multiple times in the same transaction are consistent.
However, phantom read problems may occur.
4) SERIALIZABLE (SERIALIZABLE)
This level locks each row of data read.
| Isolation level |
Dirty read possibility |
Possibility of non-repeated reading |
Phantom read possibility |
Lock read |
| READ UNCOMMITED |
Yes |
Yes |
Yes |
No |
| READ COMMITTED |
No |
Yes |
Yes |
No |
| REPEATABLE READ |
No |
No |
Yes |
No |
| SERIALIZABLE |
No |
No |
No |
Yes |