SQL Transaction Isolation Level

Introduction
Transaction is a mechanism to ensure a bunch of database operations be performed in an atomic way. Either all of the operations succeed(committed) or nothing will be persisted(rollback). By default, a sql statement will begin a transaction if there is no transaction exists in the connection. And it will end manually , or some exception or error happens which can cause the transation be rolled back.


There are four types of transaction isolation level exist based on the subsequent read result in simultanious sessions. I list them in the table below:

Dirty read (Uncommitted update and insertion) Non-repeatable read(committed update and insertion) phantom read(insertion)
Uncommitted read Y Y Y
Committed read N/A Y Y
Non-repeatable N/A N/A Y
Serializable N/A N/A N/A

 

你可能感兴趣的:(Isolation Level)