Which of the following is an optimistic concurrency control method?

2010

Which of the following is an optimistic concurrency control method?

Answer: A. Validation basedConceptConcurrency control protocols are classified by when a transaction’s conflicts with other transactions are detected. A pessimistic protocol checks at…

  1. A.

    Validation based

  2. B.

    Time stamp ordering

  3. C.

    Lock-based

  4. D.

    None of these

Attempted by 112 students.

Show answer & explanation

Correct answer: A

Concept

Concurrency control protocols are classified by when a transaction’s conflicts with other transactions are detected. A pessimistic protocol checks at the moment of every individual data access and delays or aborts the operation right there, on the assumption that interference is likely. An optimistic protocol assumes interference is rare: it lets a transaction run to completion on its own local copies without any per-access checking, and performs a single conflict check afterwards, deferring the decision to commit time.

Application

The validation-based protocol (Kung and Robinson) runs a transaction in three phases:

  1. Read phase: the transaction reads data items and writes every result into local variables, touching no database copy.

  2. Validation phase: begun only once execution has finished, it compares the transaction’s read set and write set against those of the concurrent transactions to test whether a serialisable order still exists.

  3. Write phase: only if that single deferred test succeeds are the local values copied into the database; otherwise the transaction is rolled back and restarted.

Because no check happens while the transaction executes and the one check occurs after execution, this is the deferred-check design described in the Concept section above.

Cross-check

Contrasting the remaining choices by their own mechanism:

  • Time stamp ordering: every data item carries a read-timestamp and a write-timestamp, and each individual read or write is tested against them at the instant it is issued; an out-of-order operation is rejected immediately. The checking is spread across execution rather than deferred to a single test after it.

  • Lock-based: a transaction must hold a shared or exclusive lock before each access, and a conflicting request blocks until the lock is released. Interference is prevented before it can occur, which is the pessimistic assumption.

  • None of these: does not hold, because the validation-based protocol above matches the deferred-check design exactly.

Hence the optimistic concurrency control method among the given choices is the validation-based protocol.

A note on terminology: some systems-oriented courses group every non-locking, timestamp-driven scheme under a broad "optimistic" umbrella. The name optimistic concurrency control was, however, introduced by Kung and Robinson for the validation scheme specifically, and only that scheme performs no conflict check at all while the transaction is executing, which is the sense this question uses.

Explore the full course: Isro

Loading lesson…