Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> How to ensure only one session runs PL/SQL proc at a time?

How to ensure only one session runs PL/SQL proc at a time?

From: Peter Marshall <peter.no.spam.marshall_at_excite.com>
Date: 23 Aug 2001 08:55:30 GMT
Message-ID: <9m2ge2$u4i$1@news.x-echo.com>


Does anyone know of an easy way to do this? I have a PL/SQL procedure co mpiled in a package. I want to make sure that two sessions can't be runn ing the procedure at the same time. It should work just like a database resource lock -- the second comer waits until the first one is finished,  then it can run the procedure.

I thought of using a lock on a database object (eg. the procedure tries to take exclusive lock on a table, then release it at the end of the pro cedure). But this wouldn't work, since I do DDL during the procedure, wh ich would release the lock...

I have looked around the manuals and thought about it, but nothing comes  to mind. Does anyone have a good solution for this?

Thanks and regards,
Peter

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Article poste via Voila News - http://www.news.voila.fr Le : Thu Aug 23 10:55:30 2001 depuis l'IP : 195.15.152.196 [VIP 1597792] Received on Thu Aug 23 2001 - 03:55:30 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US