Transactions: Isolation levels: ------------------- - dirty read - read uncommitted - no dirty read - read committed - repeatable read - serializable START TRANSACTION ; --- or BEGIN; SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; SET TRANSACTION ISOLATION LEVEL READ COMMITTED; SET TRANSACTION ISOLATION LEVEL REPEATABLE READ; SET TRANSACTION ISOLATION LEVEL SERIALIZABLE; COMMIT ; drop table if exists a; create table a (id int) ; insert into a values(1); insert into a values(2); -------------------------------- No isolation..... A=50 B=50 T1 T2 Read A A=A-10 Read A A=A-10 Read B B=B+10 Write A -40 Write B -60 Read B B=B+10 Write A -40 Write B -70 A=40 // B=70 -- A+B=100 A+B=110