Read uncommited (not submitted)
Lowest level,
data that can read uncommitted things, which leads to dirty reads, for example: Session a modifies a data at some point, but is not committed, and session B reads the data, which is, session a rolls back the thing, which results in inconsistent state of the data, which is dirty read!
Read commited (submit reading)Avoid dirty reading,
but will result in non-repeatable reads, for example: a time session A in a thing to query a data, the data is 1, which is the session B modified the value of the data is 2, and submitted, at this time, session A of the thing has to read the data, this is the data is 2, it appears the same transaction, read the result is not the same, this is not repeatable read
(This is the default level for both Oracle and Ms-sql)
REPEATABLE READ (repeatable Read)The default transaction isolation level of the MySQL InnoDB storage engine solves the problem of non-repeatable reads, but Phantom reads can occur; When a transaction reads a range of data rows, another transaction inserts the data, and when the user reads again, a new phantom line is found. For phantom Reading, the InnoDB storage engine solves the phenomenon of phantom reading effectively through multiple versioning concurrency control (MVCC).
SERIALIZABLE (Serializable)The highest isolation level, which enforces the ordering of transactions. So that there is no conflict between transactions, so as to solve the phantom read phenomenon, at this level, the concurrency of the database is greatly limited, under serializable, each read data row to be locked.
Summary: The lower the isolation level, the better the concurrency of the transaction, but it can also compromise the consistency of the data.
the higher the isolation level, the worse the concurrency of the transaction!
Isolation level of the sql-database