René Nyffenegger's collection of things on the web
René Nyffenegger on Oracle - Most wanted - Feedback
 

dbms_lock

Procedures/Functions

allocate_unique

procedure allocate_unique (
 lockname                        in varchar2                        ,
 lockhandle                     out varchar2                        ,
 expiration_secs                 in number(38)               default
);
This procedure allocates a lock.
When this procedure, it performs a commit.

convert

function convert returns number(38) (
 id                              in number(38)                      ,
 lockmode                        in number(38)                      ,
 timeout                         in number                   default
);
function convert returns number(38) (
 lockhandle                      in varchar2                        ,
 lockmode                        in number(38)                      ,
 timeout                         in number                   default
);

release

function release returns number(38) (
 id                              in number(38)                      
);
function release returns number(38) (
 lockhandle                      in varchar2                        
);

request

function request returns number(38) (
 id                              in number(38)                      ,
 lockmode                        in number(38)               default,
 timeout                         in number(38)               default,
 release_on_commit               in boolean                  default
);
function request returns number(38) (
 lockhandle                      in varchar2                        ,
 lockmode                        in number(38)               default,
 timeout                         in number(38)               default,
 release_on_commit               in boolean                  default
);

sleep

procedure sleep (
 seconds                         in number                          
);
Sleeps as many seconds as specified in the passed parameter.

Constants for lockmode

The argument lockmode must be one of the following constants found in the dbms_lock package:

Synchronizing sessions

dbms_lock can be used to synchronize sessions.