快捷搜索:  as  2018  FtCWSyGV  С˵  test  xxx  Ψһ  w3viyKQx

bwin什么意思_并发控制机制Optimistic concurrency control(乐观锁)和Pessimistic concurrency control(悲观锁)介绍及使用(2)



(三)SQL Server

SQL Server默认应用的是Pessibwin什么意思mistic Concurrency Control,数据库隔离级别(isolation level)是read committed。从SQL Server 2005开始,微软增添了对Optimistic Concurrency Control的支持,两个新的数据库隔离级别,SNAPSHOT 和 READbwin什么意思 COMMITTED SNAPSHOT isolation (RCSI)

SQL Server支持的隔离级别有如下几个:

Isolation level

Dirty read

Nbwin什么意思on-repeatable read

Phantom

Read uncommitted

Yes

Yes

Yes

Read committed

No

Yes

Yes

Repeatable read

No

No

Yes

Snapshot

No

No

No

Serializable

No

No

No

设置隔离级别可以用以下敕令:bwin什么意思

SET TRANSACTION ISOLATION LEVEL

查看隔离级别可以应用:

SELECT CASE transaction_isolation_level

WHEN 0 THEN 'Unspecified'WHEN 1 THEN 'ReadUncommitted'

WHEN 2 THEN 'ReadCommitted'WHEN 3 THEN 'Repeatable'

WHEN 4 THEN 'Serializable'WHEN 5 THEN 'Snapshot' END AS TRANSACTION_ISOLATION_LEVEL

FROM sys.dm_exec_sessionbwin什么意思swhere session_id = @@SPID

或者

DBCC useroptions

您可能还会对下面的文章感兴趣: