command timout in C# SQL Transaction

  • Hi All,

    I am having one Sqltransaction in C# code, through this transaction am accessing a table T1.

    Inside this transaction there are two operations,

    1. Inserting a new record R1 into the table T1.

    2. then updating the same record R1 of the table T1 inside the same transaction itself.(Its a simple straightway update statement.)

    After this two operations sqltransactions and sqlconnections are properly closed.

    But am getting command timeout while updating the record R1 in the second step.

    Please let me know if anything is going wrong.

  • karthikeyankasi (11/24/2008)


    Hi All,

    I am having one Sqltransaction in C# code, through this transaction am accessing a table T1.

    Inside this transaction there are two operations,

    1. Inserting a new record R1 into the table T1.

    2. then updating the same record R1 of the table T1 inside the same transaction itself.(Its a simple straightway update statement.)

    After this two operations sqltransactions and sqlconnections are properly closed.

    But am getting command timeout while updating the record R1 in the second step.

    Please let me know if anything is going wrong.

    are you doing the insertion and updation via stored procedure or with the inline code in c#??

    kshitij kumar
    kshitij@krayknot.com
    www.krayknot.com

  • I have two separate stored procedures for insert and update.

  • karthikeyankasi (11/24/2008)


    I have two separate stored procedures for insert and update.

    Merge both the stored procedures in one. and if not possible then

    use separate command object for separate for separate sp, or

    increase the commandout time of the sql object in c#

    kshitij kumar
    kshitij@krayknot.com
    www.krayknot.com

  • thanks for your response.

    I have separate command object for both STP calls. still am getting the time out error.

    Also, if i increase the timeout then some of the other calls for the same object met with a deadlock.

    please help me. this issue kills the app in production.

  • It's time to post the contents of the sp that's timing out. Is this sp new, or has it been around awhile? If it's been around awhile, has it been changed recently? Please also provide the table structure (create statements) for all tables involved, and indicate the indexes.

    Steve

    (aka smunson)

    :):):)

    Steve (aka sgmunson) 🙂 🙂 🙂
    Rent Servers for Income (picks and shovels strategy)

Viewing 6 posts - 1 through 5 (of 5 total)

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