- 最后登录
- 2023-8-16
- 在线时间
- 1686 小时
- 威望
- 2135
- 金钱
- 50532
- 注册时间
- 2011-10-12
- 阅读权限
- 200
- 帖子
- 5207
- 精华
- 39
- 积分
- 2135
- UID
- 2
|
2#
发表于 2012-8-9 13:43:16
RELEASE Function
This function explicitly releases a lock previously acquired using the REQUEST function. Locks are automatically released at the end of a session. RELEASE is an overloaded function that accepts either a user-defined lock identifier, or the lock handle returned by the ALLOCATE_UNIQUE procedure.
Syntax
DBMS_LOCK.RELEASE (
id IN INTEGER)
RETURN INTEGER;
DBMS_LOCK.RELEASE (
lockhandle IN VARCHAR2)
RETURN INTEGER;
Parameters
Table 53-7 RELEASE Function Parameter
Parameter Description
id or lockhandle
User assigned lock identifier, from 0 to 1073741823, or the lock handle, returned by ALLOCATE_UNIQUE, of the lock mode you want to change.
Return Values
Table 53-8 RELEASE Function Return Values
Return Value Description
0
Success
3
Parameter error
4
Do not own lock specified by id or lockhandle
5
Illegal lock handle
DBMS_LOCK.RELEASE 只对本session 有效, 所以无法实现你说说的 session 3来释放这个锁的需求,只能通过其他session kill session 1这种比较粗暴的方式来实现 |
|