First page Back Continue Last page Graphics

Locking Issues: Lost Update…


Notes:

There are several bad things that can happen to you if you do not have a solid understanding of Oracle locking rules. First, let’s examine the lost update problem.

In this situation, two sessions (users) read the same row, perhaps each using an online application that presents the row on a computer screen. Each user is new viewing the same value, in our example, 100. User 1 adds 10 dollars to the value and commits. At some later time, User 2 adds 20 to the original value of 100 (User 1’s update is lost!) and commits. User 2 did not know that someone else was updating the row and updates based on an incorrect value.

Continue to the next page for fixes to this problem…