If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Locking records in an Oracle table with time out.

How does one impliment a locking mechanism in Oracle 7.3 using VB 6 as the
front end? In one of the modules I am developing a transaction requires to
lock a few records of a table for updation later on, so that these records
are not changed by other users.

The SELECT * FROM table_name FOR UPDATE statement works, but when some other
user attempts to update the same set of records Oracle goes into a deadlock.
Is there any way to control a lock timeout in Oracle, which will generate
an error when a user attempts to obtain a lock on a record that is already
locked by some other user. This will help the application to show an error
message to the user who fails to get the required record lock.

Re: Locking records in an Oracle table with time out.

Use FOR UPDATE clause with NOWAIT keyword: it returns control to you immediately
with following error - ORA-00054: resource busy and acquire with NOWAIT specified.

Boris Milrud.

"Abhijeet" <kvabhijeet@yahoo.co.in> wrote:
>
>How does one impliment a locking mechanism in Oracle 7.3 using VB 6 as the
>front end? In one of the modules I am developing a transaction requires
to
>lock a few records of a table for updation later on, so that these records
>are not changed by other users.
>
>The SELECT * FROM table_name FOR UPDATE statement works, but when some other
>user attempts to update the same set of records Oracle goes into a deadlock.
>Is there any way to control a lock timeout in Oracle, which will generate
>an error when a user attempts to obtain a lock on a record that is already
>locked by some other user. This will help the application to show an error
>message to the user who fails to get the required record lock.