Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2002
    Location
    IL
    Posts
    73

    Unanswered: locking order - is that managed my a queue

    Hello

    I would like to know if there is an order queue when requesting a resource lock.

    In order to check I have opened 5 sqlplus windows and try to lock a table using "lock table t1 in EXCLUSIVE mode;" in each window, only the first succeeded, the others were in wait mode (of-course).

    then I have started to issue "rollback;" for each window, the order of the sessions locking the table was the same as issued at the beginning.

    My questions are:
    Is that guarantied or just a coincidence?
    Does Oracle manage some sort of queue of request for locking a specific resource?, if yes where can I view this queue? if not, what is the mechanism algorithm, random? other?




    TIA,







    Tal Olier

    otal@mercury.co.il

  2. #2
    Join Date
    Apr 2003
    Location
    Minneapolis, MN
    Posts
    273
    No ,

    It is guarenteed that all transactions requesting exclusive lock on the same object are executed in order they arrive. Because they, first, all are placed in a Queue in Data Dictionary. As a Queue works on the First come First Serves bases, these all transactions are executed in iorder.

    For more information on this topic, Please read a following book;

    Oracle8i Internal Services for Waits, Latches, Locks, and memory
    By Steve Adams which can be available at

    http://www.oreilly.com/catalog/orinternals/
    Bhavin

    MS Computer Science
    OCP DBA 9i/8i

Posting Permissions

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