![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi to All, i'm working on SQL 2005 and C# and in my app ( multithread and multiprocess ) sometime i have the following error: System.Data.SqlClient.SqlException: Transaction (Process ID ??) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction. Since we are not the DB owners we cannot try to fix the problem on SQL side so, we would like to be able to catch this kind of exception and do a retry. My question is: how can i catch this kind of exception without searching into the message the string 'deadlock victim'? Does it have some error number? Thank you in advance, Ciao! Massimo |
#3
| |||
| |||
|
|
See this link from BOL:http://msdn.microsoft.com/en-us/library/ms179296.aspx -- Ekrem Önsoy "Massimo" <massimo.fr... (AT) tiscali (DOT) it> wrote in message news:a181a798-c923-4ec8-a965-771c59e8b994 (AT) a39g2000yqc (DOT) googlegroups.com... Hi to All, i'm working on SQL 2005 and C# and in my app ( multithread and multiprocess ) sometime i have the following error: System.Data.SqlClient.SqlException: Transaction (Process ID ??) was deadlocked on lock resources with another process and has been chosen as thedeadlockvictim. Rerun the transaction. Since we are not the DB owners we cannot try to fix the problem on SQL side so, we would like to be able tocatchthis kind of exception and do a retry. My question is: how can icatchthis kind of exception without searching into the message the string 'deadlockvictim'? Does it have some error number? Thank you in advance, Ciao! Massimo |
#4
| |||
| |||
|
|
See this link from BOL:http://msdn.microsoft.com/en-us/library/ms179296.aspx -- Ekrem Önsoy "Massimo" <massimo.fr... (AT) tiscali (DOT) it> wrote in message news:a181a798-c923-4ec8-a965-771c59e8b994 (AT) a39g2000yqc (DOT) googlegroups.com... Hi to All, i'm working on SQL 2005 and C# and in my app ( multithread and multiprocess ) sometime i have the following error: System.Data.SqlClient.SqlException: Transaction (Process ID ??) was deadlocked on lock resources with another process and has been chosen as thedeadlockvictim. Rerun the transaction. Since we are not the DB owners we cannot try to fix the problem on SQL side so, we would like to be able tocatchthis kind of exception and do a retry. My question is: how can icatchthis kind of exception without searching into the message the string 'deadlockvictim'? Does it have some error number? Thank you in advance, Ciao! Massimo |
![]() |
| Thread Tools | |
| Display Modes | |
| |