ExecuteQuery Locking Record/Table?

Last post 07-05-2008 8:18 AM by bihagsasp.net. 2 replies.

Sort Posts:

  • ExecuteQuery Locking Record/Table?

    07-04-2008, 7:23 PM
    • Loading...
    • jabailo
    • Joined on 11-12-2007, 8:17 PM
    • Posts 63

    I'm getting some wierd behavior on executing a sproc that does an insert.

    I do this in Page_Load to track sessions.

    I run a sproc that inserts a record with ExecuteQuery on a SqlCommand object.

     After repeated execution of the method that calls the sproc, the table appears to get locked for that record (using a different id with the same sproc appears to run fine).

     Execution of the insert sproc takes longer and longer until it times out.

     

    Should I be adding any special parameters to my SqlCommand or SqlConnection objects to prevent this behavior?

     

    John A. Bailo
  • Re: ExecuteQuery Locking Record/Table?

    07-05-2008, 8:03 AM

    check using sql profiler

  • Re: ExecuteQuery Locking Record/Table?

    07-05-2008, 8:18 AM
    Answer

    Hi John,

    Are you using Transaction with your SqlCommand or in your stored procedure? This situation generally occurs for the transactions that are neither committed nor rolled back.


    Please, 'Mark as Answer' if this post has helped you!

    - Bihag Thaker

    http://bihagthaker.blogspot.com/

Page 1 of 1 (3 items)
Microsoft Communities
Page view counter