To ensure that a transaction does not hang if it cannot obtain a lock, which of the following statements should be executed?

Options
- UPDATE ... NOWAIT
- FOR UPDATE ... WAIT
- FOR UPDATE ... NOWAIT
- UPDATE ... WAIT


CORRECT ANSWER : FOR UPDATE ... NOWAIT

Discussion Board
FOR UPDATE ... NOWAIT

Whenever a session is waiting for a transaction, a rollback to savepoint does not free row locks. To make sure a transaction does not hang if it cannot obtain a lock, use FOR UPDATE ... NOWAIT before issuing UPDATE or DELETE statements. (This refers to locks obtained before the savepoint to which has been rolled back. Row locks obtained after this savepoint are released, as the statements executed after the savepoint have been rolled back completely.)

Prajakta Pandit 02-19-2017 10:56 PM

Write your comments

 
   
 
 

Enter the code shown above:
 
(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)


Advertisement