How Deadlock are handled in ADO.NET

  • Thread starter Thread starter GiroCarl
  • Start date Start date
G

GiroCarl

Hello everyone,

I want to know how it work in ADO.NET when a DEADLOCK occur and a
victim is choosen?

Is an exception raised?

Thank's

Carl
 
Hi Giro,

I think that you normally get a timeout - depends on a database, ado.net has
nothing to do with it.

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
miha at rthand com
www.rthand.com

GiroCarl said:
Hello everyone,

I want to know how it work in ADO.NET when a DEADLOCK occur and a
victim is choosen?

Is an exception raised?

Thank's

Carl
 
Hello Miha,

I'm a newbies in ADO.NET.

When you say that ADO.NET has nothing to do with it i'm a little
surprised because we made to programs for testing a deadlock and the
exceptio raised is a timeout expired.

But if I do exactly what those program are doing directly in Query
Analyser (database tool to make queries), the error I receive is
1205: Transaction (Process ID %d) was deadlocked on {%Z} resources
with another process and has been chosen as the deadlock victim.
Rerun the transaction.

So the behavior is different.

Carl
 
Miha,

you were right: ADO.NET has nothing to do with it.

Our two programs were not correct.

Now we have the good exception: DEADLOCK.

Thank's

Carl
 
Miha,

you were right: ADO.NET has nothing to do with it.

Our two programs were not correct.

Now we have the good exception: DEADLOCK.

Thank's

Carl
 
Hi,

You might inspect the Errors property of SqlException class when exception
occurs.

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
miha at rthand com
www.rthand.com

GiroCarl said:
Hello Miha,

I'm a newbies in ADO.NET.

When you say that ADO.NET has nothing to do with it i'm a little
surprised because we made to programs for testing a deadlock and the
exceptio raised is a timeout expired.

But if I do exactly what those program are doing directly in Query
Analyser (database tool to make queries), the error I receive is
1205: Transaction (Process ID %d) was deadlocked on {%Z} resources
with another process and has been chosen as the deadlock victim.
Rerun the transaction.

So the behavior is different.

Carl
 
Back
Top