Re: Strange error code for deadlock
From: Val Mazur (group51a_at_hotmail.com)
Date: 08/11/04
- Next message: Val Mazur: "Re: autonumber"
- Previous message: Val Mazur: "Re: AppendChunk and clearing the binary field"
- In reply to: Julien Lauper: "Strange error code for deadlock"
- Messages sorted by: [ date ] [ thread ]
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.
>
>
- Next message: Val Mazur: "Re: autonumber"
- Previous message: Val Mazur: "Re: AppendChunk and clearing the binary field"
- In reply to: Julien Lauper: "Strange error code for deadlock"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|