Four isolation levels for a "3" transaction.
Transaction ISOLATION level Dirty read non-repeatable read Phantom read
read_uncommitted allow allow allowed
read_committed prohibit allow allowed
Repeatable_read prohibit the prohibition of permission
SERIALIZABLE prohibition against prohibition
read_uncommitted (Unauthorized Read):
----> is also known as READ UNCOMMITTED to allow dirty reads, but updates are not allowed to be lost.
----> If one transaction has started writing data, the other transaction does not allow simultaneous writes, but allows other transactions to read the data on this line. This isolation level can be achieved by "exclusive write lock"
----> This is the lowest isolation level for transactions, which allows another transaction to see the uncommitted data for this transaction.
Read_committed (Authorized Read):
----> Also known as read Committed: Allows non-repeatable reads, but dirty reads are not allowed.
----> This can be achieved through "instantaneous shared read lock" and "exclusive write lock".
----> Transactions that read data allow other transactions to continue to access the row's data, but uncommitted write transactions will prevent other transactions from accessing the row.
Repeatable_read (Repeatable Read):
----> Repeatable reads (REPEATABLE READ):
----> Prohibit non-repeatable reads and dirty reads, but phantom data can sometimes occur.
----> This can be achieved through "shared read lock" and "exclusive write lock".
Transactions that----> read data will prohibit write transactions (but allow read transactions)
----> Write transactions prohibit any other transactions
SERIALIZABLE (serialization):
----> Serialization (Serializable): Provides strict transaction isolation.
----> It requires transactional serialization to execute, and the transaction can execute only one after the other, but not concurrently.
----> If transaction serialization is not possible only through row-level locks, other mechanisms must be ensured that the newly inserted data is not accessed by the transaction that just performed the query operation.
Four isolation levels for a database transaction