Oracle9i Supplied PL/SQL Packages and Types Reference Release 1 (9.0.1) Part Number A89852-02 |
|
DBMS_LOCK , 3 of 6
This function requests a lock with a given mode. REQUEST
is an overloaded function that accepts either a user-defined lock identifier, or the lock handle returned by the ALLOCATE_UNIQUE
procedure.
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;
The current default values, such as X_MODE
and MAXWAIT
, are defined in the DBMS_LOCK
package specification.
Parameter | Description |
---|---|
id or lockhandle |
User assigned lock identifier, from 0 to 1073741823, or the lock handle, returned by |
lockmode |
Mode that you are requesting for the lock. The available modes and their associated integer identifiers are listed below. The abbreviations for these locks, as they appear in the V$ views and Enterprise Manager monitors are in parentheses. 5 - share row exclusive mode (ULRSX) Each of these lock modes is explained in Oracle8 Concepts. |
timeout |
Number of seconds to continue trying to grant the lock.
If the lock cannot be granted within this time period, then the call returns a value of 1 ( |
release_on_commit |
Set this parameter to Otherwise, the lock is held until it is explicitly released or until the end of the session. |
Return Value | Description |
---|---|
0 |
Success |
1 |
Timeout |
2 |
Deadlock |
3 |
Parameter error |
4 |
Already own lock specified by |
5 |
Illegal lock handle |
|
Copyright © 1996-2001, Oracle Corporation. All Rights Reserved. |
|