Results 1 to 2 of 2

Thread: Update Locks

  1. #1
    Join Date
    Dec 2003
    Location
    USA
    Posts
    33

    Unanswered: Update Locks

    Hi,

    I have to update a single Row
    in Oracle from my application.
    Now do i have to explisitly lock the row
    or will oracle lock the row
    in a client server environment for
    updation?

    thanx

  2. #2
    Join Date
    Dec 2003
    Location
    Noida, India.
    Posts
    171

    Re: Update Locks

    Here is some information on table/row locking in oracle:

    Lock modes:
    -----------
    EXCLUSIVE
    SHARE
    ROW EXCLUSIVE
    SHARE ROW EXCLUSIVE
    ROW SHARE (or SHARE UPDATE)

    Default Locking Behavior:
    -------------------------

    A pure SELECT will not lock any rows.
    INSERT, UPDATE or DELETE's will place a ROW EXCLUSIVE lock.
    SELECT...FROM...FOR UPDATE Will place a ROW SHARE lock.

    Multiple Locks on the same rows with LOCK TABLE:
    ------------------------------------------------
    Even when a row is locked you can always perform a SELECT (because SELECT does not lock any rows) in addition to this, each type of lock will allow additional locks to be granted as follows.

    ROW SHARE = Allow ROW EXCLUSIVE or ROW SHARE or SHARE locks to be granted to the locked rows.

    ROW EXCLUSIVE = Allow ROW EXCLUSIVE or ROW SHARE locks to be granted to the locked rows.

    SHARE ROW EXCLUSIVE = Allow ROW SHARE locks to be granted to the locked rows.

    SHARE = Allow ROW SHARE or SHARE locks to be granted to the locked rows.

    EXCLUSIVE = Allow SELECT queries only

    Although it is valid to place more than one lock on a row, UPDATES and DELETE's may still cause a wait if a conflicting row lock is held by another transaction
    ---------------------

    Hope this helps

    Originally posted by khroner
    Hi,

    I have to update a single Row
    in Oracle from my application.
    Now do i have to explisitly lock the row
    or will oracle lock the row
    in a client server environment for
    updation?

    thanx
    Oracle can do wonders !

Posting Permissions

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