DBA > Job Interview Questions > DERBY Java Database FAQs

What is Update Locks?

More DBA job interview questions and answers at http://dba.fyicenter.com/Interview-Questions/

(Continued from previous question...)

What is Update Locks?

When a user-defined update cursor (created with the FOR UPDATE clause) reads data, its transaction obtains an update lock on the data. If the user-defined update cursor updates the data, the update lock is converted to an exclusive lock. If the cursor does not update the row, when the transaction steps through to the next row, transactions using the TRANSACTION_READ_COMMITTED isolation level release the lock, and transactions using the TRANSACTION_SERIALIZABLE or TRANSACTION_REPEATABLE_READ isolation level downgrade it to a shared lock until the transaction is committed. (For update locks, the TRANSACTION_READ_UNCOMMITTED isolation level acts the same way as TRANSACTION_READ_COMMITTED.)

Update locks help minimize deadlocks.

(Continued on next question...)

Other Job Interview Questions