数据库的事物处理ISOLATION LEVEL

来源:互联网 发布:windows phone7.5评测 编辑:程序博客网 时间:2024/05/18 02:24
 Serializable
 Repeatable read
 Read committed
 Read uncommitted
 
 Serializable
This level prohibits the following types of reads:
– Dirty reads: A transaction reads a database row containing uncommitted
changes from a second transaction.
– Nonrepeatable reads: One transaction reads a row, a second transaction
changes the same row, and the first transaction rereads the row and gets
a different value.
– Phantom reads: One transaction reads all rows that satisfy an SQL
WHERE condition, a second transaction inserts a row that also satisfies
the WHERE condition, and the first transaction applies the same WHERE
condition and gets the row inserted by the second transaction.
 
 Repeatable read
This level prohibits dirty reads and nonrepeatable reads, but it allows
phantom reads.
 
 Read committed
This level prohibits dirty reads, but allows nonrepeatable reads and phantom
reads.
 Read uncommitted
This level allows dirty reads, nonrepeatable reads, and phantom reads.
原创粉丝点击