I was asked the following question at an interview a few days back.
There is a table <EmployeeNo, Salary>. There is an entry ('Emp1', $100).
User A updates the tuple altering salary from $100 to $200.
Later another user B tries to update tuple from $100 to $400.
How can you prevent this?
There is a special feature in hibernate to prevent this doube update. What is it?
I said that if the two users are concurrently trying to update the tuple, then doing updates within a simple transaction would prevent a dirty read.
However, this was not the answer as users A and B were not concurrently updating.