Suppose a form is created ,which is accessed by multiuser.What should be done to prevent the table getting locked

Showing Answers 1 - 2 of 2 Answers

manish

  • Sep 17th, 2006
 

When-new-record-instance

--set property 'enter-query mode' YES (default)

Use 'For Update Cursor' with 'NoWait' for firing DMLs on table.

For Update Clause explicitly lock the table before you fire any DML and Nowait check wether the table is already locked or not if Locked then returns an error that locked by another session.

        

  Was this answer useful?  Yes

semaj

  • Feb 27th, 2007
 

Create an ON-LOCK trigger and code along these lines ....

declare

  cursor c1 is
  select * from emp
  where empno = :emp.empno
  for update nowait;

  r1         c1%rowtype;
  tab_loc exception;  

begin

   begin
       open c1;
   exception
       when others then
           if sqlcode = -54 then raise tab_loc; end if;
   end;

   fetch c1 into r1;
   close c1;

exception
   when tab_loc then
        message('Employee number '||:emp.empno||' is locked bby another user');
end;

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions