Udostępnij za pośrednictwem


MSSQLSERVER_1205

Details

Product Name

SQL Server

Product Version

10.0

Product Build Number

10.00.0000.00

Event ID

1205

Event Source

MSSQLSERVER

Component

SQLEngine

Symbolic Name

LK_VICTIM

Message Text

Transaction (Process ID %d) was deadlocked on %.*ls resources with another process and has been chosen as the deadlock victim. Rerun the transaction.

Explanation

Resources are accessed in conflicting order on separate transactions, causing a deadlock. For example:

  • Transaction1 updates Table1.Row1, while Transaction2 updates Table2.Row2.

  • Transaction1 tries to update Table2.Row2 but is blocked because Transaction2 has not yet committed.

  • Transaction2 now tries to update Table1.Row1 but is blocked because Transaction1 has not committed.

  • A deadlock occurs because Transaction1 is waiting for Transaction2 to complete, but Transaction2 is waiting for Transaction1 to complete.

The system will detect this deadlock and will choose one of the transactions involved as a 'victim' and will issue this message, rolling back the victim's transaction. For more information about deadlocks, see Deadlocking.

User Action

Execute the transaction again. You can also revise the application to avoid deadlocks. The transaction that was chosen as a victim can be retried and will likely succeed, depending on what operations are being executed simultaneously.

To prevent or avoid deadlocks from occurring, consider having all transactions access rows in the same order (Table1, then Table2); this way, although blocking might occur, a deadlock will not occur. For more information about actions to take, see Wykrywanie i końcowa zakleszczenia.

Internal-Only

<xmrFileHeader><buildNo>9.00.1281.60</buildNo><component>SQLEngine</component><dsDbName></dsDbName><dsProjectName>SQLServer2005</dsProjectName><exportDate>2005-08-22T14:00:12</exportDate><importDate>2005-08-22T12:43:00</importDate><prodContact>pingwang</prodContact><prodName>SQL Server</prodName><prodVer>9.0</prodVer><sourceFileDepotPath></sourceFileDepotPath><sourceFileExt></sourceFileExt><sourceFileName></sourceFileName><userDefined></userDefined><xmrFilePath>.\sqlXMR.xml</xmrFilePath></xmrFileHeader><resourceString resourceStringGuid="9fe3f67c-df3c-4642-a3a4-ccc0e138b632" resourceStringProxyID="MSSQL_ENG001205"><exportStatus>Do Not Export</exportStatus><importStatus>Unchanged</importStatus><inActive>No</inActive><inserts></inserts><message><cause>Resources are accessed in conflicting order on separate transactions, causing a deadlock. For example, Transaction1 updates Table1.Row1 while Transaction2 updates Table2.Row2. If Transaction1 attempts to update Table2.Row2 it will get blocked as Transaction2 has not yet committed. If Transaction2 now attempts to update Table1.Row1 a deadlock will occur as Transaction1 is waiting for Transaction2 to complete, but Transaction2 is waiting for Transaction1 to complete. The system will detect this deadlock and will choose one of the transactions involved as a 'victim' and will issue this message, rolling back the victim's transaction.</cause><causeCorrectiveActionStatus>Dev Signed Off</causeCorrectiveActionStatus><correctiveAction>Reexecute the transaction and/or revise the application to avoid deadlocks. The transaction that was chosen as a victim can be retried and, depending on what operations are being executed simultaneously, likely will not deadlock on a subsequent execution. To prevent/avoid deadlocks from occurring, consider having all transactions access rows in the same order (Table1, then Table2); this way, although blocking may occur, a deadlock will not occur.</correctiveAction><error><exMsgBoxID></exMsgBoxID><exMsgBoxSource></exMsgBoxSource></error><event><eventCategory></eventCategory><eventFacility></eventFacility><eventLanguage></eventLanguage><eventSeverityType></eventSeverityType><eventType></eventType><momEvent>Yes</momEvent><momOwner>donv</momOwner><winRegEventID>1205</winRegEventID><winRegEventSource>MSSQLSERVER</winRegEventSource></event><msuid></msuid></message><numericID>1205</numericID><owner>santeriv</owner><pssReview><pssComments></pssComments><pssDebugger>No</pssDebugger><pssEngineer></pssEngineer><PSSSupportability>No</PSSSupportability></pssReview><suspect>No</suspect><symbolicName>LK_VICTIM</symbolicName><text>Transaction (Process ID %d) was deadlocked on %.*ls resources with another process and has been chosen as the deadlock victim. Rerun the transaction.</text><type></type><ueReview><assignedTo></assignedTo><bugID></bugID><bugRequired>No</bugRequired><comments></comments><docStudio><dsTopicId></dsTopicId><export>Yes</export></docStudio><editor></editor><revisedStringText></revisedStringText><workStatus>Not Reviewed</workStatus><writer></writer></ueReview><userDefined><eventLoggingLevel></eventLoggingLevel></userDefined></resourceString>