RE: How do you use DBMS_LOCK?

  • From: "Powell, Mark D" <mark.powell@xxxxxxx>
  • To: "'oracle-l@xxxxxxxxxxxxx'" <oracle-l@xxxxxxxxxxxxx>
  • Date: Mon, 16 Feb 2004 10:07:48 -0500

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.

-- Mark D Powell --

-----Original Message-----
From: oracle-l-bounce@xxxxxxxxxxxxx
[mailto:oracle-l-bounce@xxxxxxxxxxxxx]On Behalf Of Ryan
Sent: Saturday, February 14, 2004 9:50 AM
To: oracle-l@xxxxxxxxxxxxx
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. 
----------------------------------------------------------------
Please see the official ORACLE-L FAQ: http://www.orafaq.com
----------------------------------------------------------------
To unsubscribe send email to:  oracle-l-request@xxxxxxxxxxxxx
put 'unsubscribe' in the subject line.
--
Archives are at //www.freelists.org/archives/oracle-l/
FAQ is at //www.freelists.org/help/fom-serve/cache/1.html
-----------------------------------------------------------------
----------------------------------------------------------------
Please see the official ORACLE-L FAQ: http://www.orafaq.com
----------------------------------------------------------------
To unsubscribe send email to:  oracle-l-request@xxxxxxxxxxxxx
put 'unsubscribe' in the subject line.
--
Archives are at //www.freelists.org/archives/oracle-l/
FAQ is at //www.freelists.org/help/fom-serve/cache/1.html
-----------------------------------------------------------------

Other related posts: