There is an article on the blog about the 4 transaction isolation levels of mysql. What are the 4 transaction isolation levels?
Repeatable Read (read uncommitted) 3, Repeatable read (read committed) 4, serialIZABLE
This article explains why the default isolation level for Oracle and SQL Server is “committed read” and mysql is “repeatable read” by default. Unfortunately, it is not clear how the four transaction isolation levels differ. Or, I couldn’t read it, so I looked it up on the Internet and made a note.
1. Uncommitted reads are also called dirty reads. Party A and Party B edit the same table together. The transaction has not been submitted yet, but each other can already see the result of modification.
Commit read Only after the transaction is committed, others can see the result of their own modification.
Repeatable read In a transaction, a piece of data, no matter how many times read, is the same result. This is a little stricter than “submitted for reading.” User A starts a transaction and reads a piece of data for two times. During the transaction, User B edits and submits the data. In the “Committed Read” level, the read results are different. At the “repeatable read” level, a sees nothing in a transaction. Whether this is a good thing or a bad thing, though, is hard to say. If it were me, I’d say “committed to read”. Repeatable, typical of both ears out of the window, real data have changed, you are still locked in their own business cool, may be misleading; After the transaction is over, the real result may also eat a catty.
4, serialization this is simple and crude, originally parallel database, can only queue operation. No matter reading or revising, you have to queue up. It turns out to be absolutely correct, but the efficiency, um.
Resources: What transaction isolation level should mysql choose for an Internet project
MySQL transaction isolation level in 5 minutes