1.read UNCOMMITTED
You can see uncommitted data (dirty reads), for example: You believe what people say, but maybe he just says it and doesn't actually do it.
2.read committed
Reads the submitted data. However, data results that may be read multiple times are inconsistent (non-repeatable read, Phantom Read). The reading and writing view is: Read the row data, can write.
3.repeatable Read (MySQL default isolation level)
Can be read repeatedly, but with Phantom read. Read-write view: The data rows read are not writable, but new data can be added to the table. In MySQL, new data for other transactions is not visible and does not produce phantom reads. The multi-version concurrency control (MVCC) mechanism is used to solve the phantom reading problem.
4.serializable
Readable, non-writable. Like a lock in Java, writing data must wait for the end of another transaction.
"Dirty read:" When transaction one is uncommitted, transaction two queries the transaction for an updated data, at which time transaction two reads a transaction that holds the data in memory.
"Non-repeatable READ:" Transaction one in the query data, query two times different, between the two times, transaction two updated data, resulting in inconsistent data.
"Phantom reads:" The number of records in the query table for a transaction is different, because the two intermediate transactions two add or remove data row data, resulting in inconsistent record rows.
About four isolation levels in the database