开发者

Is there an equivalent to sp_getapplock, sp_releaseapplock in oracle

开发者 https://www.devze.com 2022-12-26 09:21 出处:网络
I need the ability to use custom locks at a session level (outside the scope of a transaction) in oracle.

I need the ability to use custom locks at a session level (outside the scope of a transaction) in oracle.

开发者_Python百科In MSSQL I am using sp_getapplock, sp_releaseapplock.

How can I achieve the same functionality in Oracle?


DBMS_LOCK Package

This will do what you want:

dbms_lock.allocate_unique('control_lock', v_lockhandle);
v_result := dbms_lock.request(v_lockhandle, dbms_lock.ss_mode);
...
v_result := dbms_lock.release(v_lockhandle);

http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28419/d_lock.htm

0

精彩评论

暂无评论...
验证码 换一张
取 消