FIX: Deadlocked query when ALLOW_SNAPSHOT_ISOLATION and READ_COMMITTED_SNAPSHOT are enabled in SQL Server 2012
- You have a Microsoft SQL Server 2012 database that has the ALLOW_SNAPSHOT_ISOLATION and READ_COMMITTED_SNAPSHOT options enabled.
- You have at least three concurrent queries that run against the same table.
- The queries use the (TABLOCK, UPDLOCK) query hint.
- Each query is wrapped in an explicit BEGIN TRAN statement, but the COMMIT TRAN statementis not executed.
When READ_COMMITTED_SNAPSHOT is enabled together with the TABLOCK and UPDLOCK query hints, the sessions take IX locks on the table. The deadlock occurs when the two concurrent sessions try to convert the IX locks to X locks at the same time. If READ_COMMITTED_SNAPSHOT is disabled, the sessions will obtain SIX locks that will not deadlock when they are converted to X locks. The hotfix addresses this behavior by granting LCK_M_SCH_S locks instead of IX locks when READ_COMMITTED_SNAPSHOT is used with TABLOCK and UPDLOCK hints.
Note This issue also occurs in Microsoft SQL Server 2008 R2. A hotfix for SQL Server 2008 R2 will be released soon.
About cumulative updates for SQL Server
Article ID: 2923460 - Last Review: 04/27/2014 13:28:00 - Revision: 2.0
- kbqfe kbfix kbsurveynew kbexpertiseadvanced KB2923460