1 uncommitted read (READ UNCOMMITTED): Dirty data will appear because the table is not locked.
2 Commit read (Read Committed): 1. Update in transaction 1 locks the table and can select to the latest data.
Transaction 2select cannot find the data. Will always wait. Plus with (NOLOCK) you can read it.
2.select is an unlocked table, so other transactions can modify the data. When there are two select,
The second select will show dirty data. cannot be read repeatedly.
3 REPEATABLE READ (REPEATABLE Read):
To resolve the problem of submitting read non-repeatable reads, the results of two queries are consistent.
This only resolves the data modification (update) results in the same case.
In the case of INSERT, the new data will still be select. This is called Phantom Reading.
4 Serializable (Serializable)
Can solve the phantom reading problem. Event 1 is not in advance, all operations lock the table. Includes select.
The other event actions do not affect event 1.
Four isolation levels for SQL transactions