Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2003

    Unanswered: Locking problem!

    Hi all,
    Please execuse my primitive knowledge on MS SQL.

    My application is written in C++ and uses Odbc to send SQL queries to the SQL database.

    I am running a load test on a database ( 150 users simulater), the load test includes writing to the database. Occasionally I get locking contention on one of the tables ( TAB, KEY & PAG lock type). I knew that by running sp_lock on Query Analyzer.

    My question: How can I detect (programatically) about this locking problem and what might caused it and how to release the lock ( I guess these are three questions already!)

    I appreciate any helpful info


  2. #2
    Join Date
    Feb 2002
    Houston, TX
    you can call sp_lock from your application and process the results as needed.

    You might want to read the post at as I have given a few examples of wht locks occure.

    Locks are release when your transaction auto commits all open transactions or you issue a commit/rollback transaction.
    Paul Young
    (Knowledge is power! Get some!)

  3. #3
    Join Date
    Apr 2003
    Thanks Paul,

    The commit/rollback action is called appropriately when needed and at the end of each query. This problem happens occasionally for high number of users trying to get in at the same time. I am asking what might cause a dangling lock other than missing a commit/rollback actions?

    Thanks gain


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts