Tuesday, December 14, 2010
How to aviod locks
Declareis_locked boolean := false;dummy VARCHAR2(2);BeginBeginSelect null INTO dummy from mytablewhere rowid = :myblock.rowidfor update nowait;exception when Others thenIf sqlcode = -00054 Thenis_locked := True;End If; end;IF is_locked thenShowmessage('Another user is updating this record. Try again later.');raise form_trigger_failure;ElseLOCK_RECORD;If Not Form_success ThenRAISE form_trigger_failure;End If;End if;End;
http://forums.oracle.com/forums/thread.jspa?threadID=322077
http://forums.oracle.com/forums/thread.jspa?threadID=322077
Subscribe to:
Posts (Atom)