Concurrency control is required to ensure data isolation and consistency because of the damage to the acid characteristics caused by the concurrency control of multiple transactions on the database. Problems caused by multiple transaction concurrency 1. Loss of modification (Lost update,read uncommited) T1 T2 R (a) =16 R (a) =16 W (a) =a-1 W (A) =a-1 T1 modification is lost. 2. Non-repeatable read (non-repeatable read) 2.1t1 read the data, T2 modified the data, when the T1 read again just before the data found inconsistent. 2.2T1 read the data, T2 delete the data, T1 the same conditions to re-read the data, found that the data disappeared 3 2.3T1 read data, T2 Insert data, T1 the same conditions to re-read data, found that increased data. 2.2 and 2.3 are known as phantom Phenomena (SERIALIZABLE). 3. Read dirty data (Dirty Read) T1 modify the data and write back to the disk, T2 read the data, T1 for some reason was revoked, then T1 has reverted to the original value, T2 read data and data in the database inconsistent. Second, concurrency technology
Database Fundamentals-Concurrency control