Monday, June 16, 2008

SELECT FOR UPDATE and NOWAIT

SELECT FOR UPDATE[SFU in short] in Oracle lets you lock the records satisfied by the Where clause in advance.By default when you issue this command it will wait indefinitely for the locks.So if someone has already locked a record, you will never get the control back.
On the other hand if you include the optional keyword NOWAIT, the control will immediately come back to application, if the record is locked by some one else.

No comments: