Let's say that I have a procedure
called myproc
. This is a complex process and i cannot allow two instances executing at the same time the proc.
Actually I do this using the dbms_application_info.set_module
:
procedure start_process is
begin
dbms_application_info.set_module('myproc', 'running');
end;
and verify before run the process:
select 'S'
from v$session v
where v.module = 'myproc'
and v.action = 'running';
In the database level, is there a better way to check this?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…