DEVFYI - Developer Resource - FYI

What is pessimistic concurrency?

JDBC Interview Questions and Answers


(Continued from previous question...)

What is pessimistic concurrency?

With a pessimistic approach, locks are used to ensure that no users, other than the one who holds the lock, can update data. It's generally explained that the term pessimistic is used because the expectation is that many users will try to update the same data, so one is pessimistic that an update will be able to complete properly. Locks may be acquired, depending on the DBMS vendor, automatically via the selected Isolation Level. Some vendors also implement 'Select... for Update', which explicitly acquires a lock.

(Continued on next question...)

Other Interview Questions