The figure shows positioned updates and deletes with optimistic concurrency control. The following table shows what happens in the application and in Db2® at three points.
Table 1. With concurrency control
Time Event in application Response in Db2
1 FETCH row 1 Lock row 1, unlock row 1
2 FETCH row 2 Lock row 2, unlock row 2
3 UPDATE WHERE CURRENT OF
  1. Lock row 2
  2. Compare by value
  3. Update row 2 if values match