Results 1 to 2 of 2

Thread: updlock

  1. #1
    Join Date
    Sep 2003
    Posts
    2

    Unanswered: updlock

    Hi, I am a bit confused as to what updlock means

    For example if I performed

    select q1.\"UUIDFLD\"
    from CONTEXTUALPROCLET q1(UPDLOCK)
    where etc


    what does that updlock mean? Am I locking the row, or the table CONTEXTUAL PROCLET or neither of these?

    The problem is that I am getting deadlocks and this is not my code
    I am unfamiliar with databases and so any help would be gratefully recieved:

    I have several methods like that above, which perform various concrrent queries on the CONTEXTUAL PROCLET database, all containing that UPDLOCK statement.

    The method that always causes problems with these methods has a defined access intent of wsPessimisticUpdate which, I understand, locks a row of the table.

  2. #2
    Join Date
    Jan 2003
    Location
    India
    Posts
    523

    Re: updlock

    Originally posted by tpemckiernan
    Hi, I am a bit confused as to what updlock means

    For example if I performed

    select q1.\"UUIDFLD\"
    from CONTEXTUALPROCLET q1(UPDLOCK)
    where etc


    what does that updlock mean? Am I locking the row, or the table CONTEXTUAL PROCLET or neither of these?

    The problem is that I am getting deadlocks and this is not my code
    I am unfamiliar with databases and so any help would be gratefully recieved:

    I have several methods like that above, which perform various concrrent queries on the CONTEXTUAL PROCLET database, all containing that UPDLOCK statement.

    The method that always causes problems with these methods has a defined access intent of wsPessimisticUpdate which, I understand, locks a row of the table.

    updlock is the update lock which holds locks until the end of the statement or transaction,it won't block other users from reading the data but won't allow them to update the data until this lock is released..

    from BOL:

    Use update locks instead of shared locks while reading a table, and hold locks until the end of the statement or transaction. UPDLOCK has the advantage of allowing you to read data (without blocking other readers) and update it later with the assurance that the data has not changed since you last read it.

Posting Permissions

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