Skip to Main Content
Oracle in a Nutshell
book

Oracle in a Nutshell

by Rick Greenwald, David C. Kreines
December 2002
Intermediate to advanced content levelIntermediate to advanced
928 pages
85h 29m
English
O'Reilly Media, Inc.
Content preview from Oracle in a Nutshell

Calls

PROCEDURE DBMS_LOCK.ALLOCATE_UNIQUE (lockname IN VARCHAR2, lockhandle OUT VARCHAR2, expiration_secs IN INTEGER DEFAULT 864000);

Allocates a unique lockhandle for the lock identified by lockname to last for expiration_secs seconds. Also performs a COMMIT.

FUNCTION DBMS_LOCK.CONVERT ({id IN INTEGER | lockhandle IN VARCHAR2}, lockmode IN INTEGER, timeout IN NUMBER DEFAULT MAXWAIT) RETURN INTEGER;

Converts the lock identified by either id or lockhandle to the mode specified by lockmode, waiting for up to timeout seconds for successful completion. lockmode must be a valid constant as defined in the DBMS_LOCK package. Return values are 0 = success; 1 = timed out; 2 = deadlock; 3 = parameter error; 4 = do not own lock, cannot convert; or 5 = illegal lockhandle.

FUNCTION DBMS_LOCK.RELEASE ({id IN INTEGER | lockhandle IN VARCHAR2}) RETURN INTEGER;

Releases the lock identified by either id or lockhandle. Return values are the same as for the CONVERT function.

FUNCTION DBMS_LOCK.REQUEST ({id IN INTEGER | lockhandle IN VARCHAR2}, lockmode IN INTEGER DEFAULT X_MODE, timeout IN INTEGER DEFAULT MAXWAIT, release_on_commit IN BOOLEAN DEFAULT FALSE) RETURN INTEGER;

Acquires the lock identified by either id or lockhandle in the mode specified by lockmode, waiting for up to timeout seconds for successful completion. When release_on_commit is TRUE, the lock is automatically released as the result of the transaction COMMIT or ROLLBACK. lockmode must be a valid constant as defined in the DBMS_LOCK ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Oracle Internals

Oracle Internals

Donald K. Burleson
Oracle PL/SQL

Oracle PL/SQL

Lewis Cunningham
Oracle Essentials: Oracle9i, Oracle8i and Oracle8, Second Edition

Oracle Essentials: Oracle9i, Oracle8i and Oracle8, Second Edition

Rick Greenwald, Robert Stackowiak, Jonathan Stern

Publisher Resources

ISBN: 0596003366Errata Page