Re: Strange error code for deadlock

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

From: Val Mazur (group51a_at_hotmail.com)
Date: 08/11/04


Date: Wed, 11 Aug 2004 00:11:21 -0400

Hi,

Since you are working through OLEDB provider, it could return error
information different way. I do not think there is 100% reliable way use
specific error codes in some cases

-- 
Val Mazur
Microsoft MVP
"Julien Lauper" <Julien.lauper@example.com> wrote in message 
news:uj5G7vsfEHA.396@TK2MSFTNGP12.phx.gbl...
> 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

  • Strange error code for deadlock
    ... I am currently writing an deadlock handler for our application (a COM ... Having searched both ADO and SQL Server references, ... "NativeError" field. ... error message to find "deadlock victim" for example); ...
    (microsoft.public.vb.database.ado)
  • Re: Deadlock error
    ... After a deadlock is identified, SQL Server ends a deadlock by choosing the ... thread automatically (the deadlock victim) that can break the deadlock. ... Server rolls back the deadlock victim's transaction, ...
    (microsoft.public.sqlserver.programming)
  • 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: Does asynchronous operation supported by oledb provider for openquery?
    ... The result rowset is forward readonly and dynamic collumns. ... for OleDB Provider? ... If SQL Server use any of IDBAsynchStatus/IDBAsynchNotify ... stop populating and end rowset. ...
    (microsoft.public.sqlserver.programming)