To detect a deadlock I'using this code :

try
{
  // do some operation that might deadlock
}
catch (Exception ex)
{
  if (ex is StorageException && ex.InnerException != null && ex.InnerException is System.Data.SqlClient.SqlException)
  {
    if (((System.Data.SqlClient.SqlException)ex.InnerException).ErrorCode == -2146232060) // deadlock
    {
       // log deadlock
       throw;
    }
  }
  // handle other exceptions
}

This is not very practical and I'm not sure it will work with another database (currently using sql server).

I've seen a ticket for this (http://code.google.com/p/dataobjectsdot ... tail?id=29) Do you plan to implement this feature?

It would be useful for us.

Regards,

This thread was imported from our support forum. The original discussion may contain more detailed answer.

asked Jan 13 '10 at 09:56

olorin's gravatar image

olorin
358878792

edited Sep 08 '10 at 06:14

Alex%20Yakunin's gravatar image

Alex Yakunin
29714412

Yes, this must be done ASAP.

(Jan 13 '10 at 09:56) Alex Yakunin Alex%20Yakunin's gravatar image

One Answer:

Fixed a long time ago.

answered Sep 07 '10 at 04:11

olorin's gravatar image

olorin
358878792

not in all cases: http://code.google.com/p/dataobjectsdotnet/issues/detail?id=728 http://code.google.com/p/dataobjectsdotnet/issues/detail?id=729

(Sep 09 '10 at 07:35) pil0t pil0t's gravatar image

True - to be fixed. I assigned both issues to the nearest release.

(Sep 09 '10 at 09:51) Alex Yakunin Alex%20Yakunin's gravatar image
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!
toggle preview

Subscription:

Once you sign in you will be able to subscribe for any updates here

Tags:

×574
×52
×31
×7

Asked: Jan 13 '10 at 09:56

Seen: 7,558 times

Last updated: Sep 09 '10 at 09:51

powered by OSQA