Home » SQL & PL/SQL » SQL & PL/SQL » lock timeout
lock timeout [message #185368] Tue, 01 August 2006 06:49 Go to next message
khosravi
Messages: 68
Registered: April 2006
Member
hello
i have a question please if may answer

in microsoft sqlserver we can use "set lock_timeout" statement to specify the time that transaction cat wait for a lock, if in that time lock not unlocked an error will raised

i want know how i can do that in oracle?
thanks
Re: lock timeout [message #185374 is a reply to message #185368] Tue, 01 August 2006 07:13 Go to previous message
dmitry.nikiforov
Messages: 723
Registered: March 2005
Senior Member
SELECT ... FROM ... FOR UPDATE WAIT {seconds}

For example:

The first session:

SQL> update emp set ename = ename where ename = 'SMITH';

1 row updated.


The second one:

SQL> select null from emp where ename = 'SMITH' for update wait 3;
select null from emp where ename = 'SMITH' for update wait 3
                 *
ERROR at line 1:
ORA-30006: resource busy; acquire with WAIT timeout expired


The transaction waits 3 seconds for lock release, after that
the error is raised.

Rgds.
Previous Topic: viewing triggers and procedures
Next Topic: Interface to an external system
Goto Forum:
  


Current Time: Tue Dec 06 04:24:42 CST 2016

Total time taken to generate the page: 0.11538 seconds