Wait/Sleep in PLSQL
I want to test sync/async call to a procedure named pro1. For that purpose, I want to put lock call in pro1.
DECLARE
t INTEGER;
BEGIN
t := 60;
DBMS_LO开发者_如何转开发CK.sleep(t);
END;
/
Just want to make sure, would that wait/lock a sync call? i.e. my proc1 wouldn't exit untill that lock is finished?
P.S: While the Proc1 is being run, there is another procedure. I want to test its execution while there is a lock on connection by Pro1
DBMS_LOCK.sleep
will put the session process to sleep, i-e: this session will do nothing for 60 seconds.
I'm not sure what you mean by a "lock on connection". If the session that runs the sleep
procedure has any lock pending, they will be kept during the sleep and other sessions that might be blocked by it will have to wait for the first session to either commit or rollback as usual.
精彩评论