I have a program on my production server, that returned this error:
-
My main concern is if my program is on the production server why is
it returning the location of my source code in the error? -
Also what is the best way to debug this type of deadlock error and
is it caused by a lack of resources on the server?
Transaction (Process ID 73) was deadlocked on thread | communication
buffer resources with another process and has been chosen as the
deadlock victim. Rerun the transaction. : at
System.Data.SqlClient.SqlConnection.OnError(SqlException exception,
Boolean breakConnection)at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException
exception, Boolean breakConnection)at
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject
stateObj)at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior,
SqlCommand cmdHandler, SqlDataReader dataStream,
BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject
stateObj)at System.Data.SqlClient.SqlDataReader.HasMoreRows()
at System.Data.SqlClient.SqlDataReader.ReadInternal(Boolean
setTimeout)at System.Data.SqlClient.SqlDataReader.Read()
at
Microsoft.Data.Extensions.Materializer`1.d__a.MoveNext()at
Microsoft.Data.Extensions.Materializer`1.d__0.MoveNext()at
System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()at System.Collections.Generic.List
1..ctor(IEnumerable1
collection)at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
at Console.Export.DataProvider.ExportData(IEnumerable`1
activitiesParam) in D:\Documents and
Settings\USER\Desktop\11_16_2011\ITS\Console\Export\DataProvider.cs:line
44at Console.Export.WarDataProvider.GetValues() in D:\Documents and
Settings\USER\Desktop\11_16_2011\ITS\Console\Export\DataProvider.cs:line
31at Console.Export.ExportEngine.Export(IDataProvider provider) in
D:\Documents and
Settings\USER\Desktop\11_16_2011\ITS\Console\Export\ExportEngine.cs:line
25
Proper examining of the deadlocks may be done with Sql Profiler, which has the some events for this
but
It shows not all the gathered useful info – saving the events as xml and digging inside of this xmls can give you much more info about the problem
or
You can use internal logging of deadlocks by sql server into its own errorlog. The behavior is controlled with the trace flags 1222 and 1204.
and
Often the proper indexing solving the deadlock problem if one of the involved in deadlock statements uses table or pk scan