Strange error code for deadlock

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Julien Lauper (Julien.lauper_at_example.com)
Date: 08/10/04


Date: Tue, 10 Aug 2004 13:19:20 +0200

Hello,

I am currently writing an deadlock handler for our application (a COM
DLL calling a SQL Server 2000 database.)

Having searched both ADO and SQL Server references, I believe that the
correct means to catch this error is to iterate through the "Errors"
collection of the "Connection" object, looking for the value 1205 in
"NativeError" field.

Unfortunately, I don't find this value. The error that I find has the
following characteristics:

Description: "Transaction (Process ID 55) was deadlocked on {lock}
resources with another process and has been chosen as the deadlock
victim. Rerun the transaction."

NativeError: -2147467259 (Hex: 80004005)
Error: 265946
SQLState: (Nothing)
SQLSource: Microsoft OLE DB Provider for SQL Server

As you can see there is a quick and dirty workaround (analysing the
error message to find "deadlock victim" for example); nevertheless I
would like to know why the NativeError does not behave as it should (or
as I expect - I might be wrong).

Any idea?

Many thanks in advance

Julien Lauper

--
My real address is at eads hyph. telecom dot com.


Relevant Pages

  • Re: Strange error code for deadlock
    ... Since you are working through OLEDB provider, ... > I am currently writing an deadlock handler for our application (a COM ... > Having searched both ADO and SQL Server references, ... > error message to find "deadlock victim" for example); ...
    (microsoft.public.vb.database.ado)
  • Re: SQL Server Performance Issue
    ... Deadlock were already there in the system. ... but comes the high log flush time issue and system is slow down. ... other log files, does it solve problem of high log flush time. ... You will get deadlock tracaes in the SQL Server error log by adding ...
    (microsoft.public.sqlserver.server)
  • Re: DBCC TRACEON did not capture info on deadlocking
    ... enabled tracing through DBCC TRACEON. ... And is there any other alternatives I have in capturing the deadlock ... Links for SQL Server Books Online: ...
    (comp.databases.ms-sqlserver)
  • Re: Select statement Causing Table Locks
    ... Ok, it is technically a blocking chain, but this query does not continue. ... a deadlock is when two or more processes all block each ... SQL Server will detect deadlock situations, ...
    (microsoft.public.sqlserver.programming)
  • Deadlocks and Parallel Query Processing
    ... SQL Server 2000 SP3A ... Last week one of our processes starting issuing or suffering deadlock ... detected errors every 15 minutes or so. ... best I can tell from trying to query the actual data each update hits ...
    (comp.databases.ms-sqlserver)