getting error of deadlock in one SP

  • Hi,

    i have created a window service with multithreading, but getting many deadlocks on sql in

    one Stored procedure when i start this service,and after that service does not do

    anything but in idle mode.

    the details of exception is below.

    Error :Wednesday, September 23, 2009 2:22:58 AM

    Method:UPD_CrawlerLastUrl

    1. Transaction (Process ID 68) was deadlocked on lock | communication buffer

    resources with another process and has been chosen as the deadlock victim. Rerun the

    transaction.

    2. 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.SqlCommand.FinishExecuteReader(SqlDataReader ds,

    RunBehavior runBehavior, String resetOptionsString)

    at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior

    cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)

    at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior

    cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method,

    DbAsyncResult result)

    at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result,

    String methodName, Boolean sendToPipe)

    at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()

    at HJS_CrawlerService.Class.clsDB.UPD_CrawlerLastUrl(String url, Int32 xml_id, Int64

    curpage, String page_counter, String thread_id, String keyword, Int32 last_url_count)

    3. .Net SqlClient Data Provider

    ===================================================================

    ===========================================

    Any help would be appreciable

    Thanks,

    Ashish Pandey

  • I suggest you start reading this about deadlocking.

    Once you understand deadlocking you can get more information about what is causing the problem by either enabling traceflag 1204 or 1222 or using SQL Profiler[/url]

    [font="Verdana"]Markus Bohse[/font]

  • ashish.pandey-891490 (9/23/2009)


    Hi,

    i have created a window service with multithreading, but getting many deadlocks on sql in

    one Stored procedure

    different processes that are created from your multithreaded application are all accessing the same resource or in contention for the same resource. May be thats the reason. You need see what you are doing in that service and try not locking any objects if possible. It looks like a design issue of your windows service.

    ---------------------------------------------------------------------------------

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply