Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: How do you use DBMS_LOCK?
DBMS_LOCK is very useful to single thread batch or online processes that
should not be ran concurrently. Any operation where multiple people have the
ability to trigger the event, but the event should happen only once and the
process data would appear to both user sessions as available for processing
is a candidate to be protected by a USER lock. If the application requests
the lock on startup and finds it in use it terminates because the task is
already running. If the lock is not in use, i.e.. it is granted, then the
job runs.
-----Original Message-----
From: oracle-l-bounce_at_freelists.org
[mailto:oracle-l-bounce_at_freelists.org]On Behalf Of Ryan
Sent: Saturday, February 14, 2004 9:50 AM
To: oracle-l_at_freelists.org
Subject: How do you use DBMS_LOCK?
Tom Kyte has a use for it in his book. You create your own Insert Lock. I
used it once last year. All I did was create a wrapper to make it easier for
others to use it. I was just a contractor there so I didnt get the big
picture.
What have you used DBMS_LOCK for? Anything interesting any useful? Anyone
have any code samples? I've used locks in java and unix when I do threading,
I have not seen much cause for it inside the Oracle database.
FAQ is at http://www.freelists.org/help/fom-serve/cache/1.htmlput 'unsubscribe' in the subject line.
-----------------------------------------------------------------
----------------------------------------------------------------
Please see the official ORACLE-L FAQ: http://www.orafaq.com
----------------------------------------------------------------
To unsubscribe send email to: oracle-l-request_at_freelists.org
![]() |
![]() |