Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> How to ensure only one session runs PL/SQL proc at a time?
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