Operation and understanding mysql database transactions

-------------------- ----------------------------- Affairs -----------------
query mysql transaction isolation level
1. Review the current session isolation level for
the SELECT @@ TX_ISOLATION;
2. Display the current isolation level of
the SELECT @@ global.tx_isolation;
3. setting the current session isolation level
sET the session Repeatable Read transaction level isolatin;
4. provided the current isolation level system
sET Global transaction level Repeatable Read isolation;
5. the command line, at the start of a transaction
set autocommit = off or start transaction
understanding of isolation level
1. read uncommitted
can see the data (dirty reads) uncommitted, for example: people say you believe, but maybe he just talk, we do not actually do it.
2.read committed
to read the data submitted. However, the data may be read many times inconsistent results (non-repeatable read, phantom read). Is used to read and write opinions: line data read, can write.
3.repeatable read (MySQL default isolation level)
can be read repeatedly, but phantom reads. Reading and writing point of view: can not write data line read, but can add data to the table. In MySQL, other transactions additional data, see, does not produce phantom reads. Multi-version concurrency control (MVCC) mechanism to solve the problem of phantom read.
4.serializable

Guess you like

Origin www.cnblogs.com/tongcc/p/11302816.html