Scenario: Two transactions, T1 and T2, are simultaneously accessing the same row in a table in DB2.

  • DB2 will abort T2 and allow T1 to proceed with the update.
  • T1 and T2 will deadlock, causing one of the transactions to abort.
  • T1 will be allowed to update the row while T2 waits for the shared lock.
  • T1 will be blocked until T2 releases the shared lock.
In this scenario, DB2 will utilize the concurrency control mechanism to manage locks efficiently. When transaction T1 holds an exclusive lock on a row, transaction T2 requesting a shared lock will be blocked until T1 releases its lock. Therefore, T1 will be blocked until T2 releases the shared lock, which maintains data consistency and avoids the risk of concurrent updates. 
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *