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

1 comment:

  1. It is really very nice, the above given information was wonderful and it's very helpful for me thanks for posting this blog...... R12 SCM Online Training

    ReplyDelete