Skip to content

English practice

Reading: Multiple Choice, Single Answer · Question 779

Pessimistic versus optimistic locking

PTE · Reading · hard

Read the text and answer the multiple-choice question by selecting the correct response. Only one response is correct.

Optimistic concurrency control lets database transactions perform work before checking whether relevant concurrent changes prevent a safe commit. If validation detects a conflict, a transaction may have to abort and repeat its work. This can avoid unnecessary waiting when conflicts are uncommon, but frequent conflicts can make repeated work expensive. A locking approach makes different trade-offs by restricting some access while work is in progress. Neither label alone determines which arrangement will perform better. The pattern of access and contention matters because the cost avoided by one approach can reappear in another form.

Two workloads have the same proportion of writes, but one concentrates concurrent requests on shared records while the other mostly spreads them across separate records. Which hypothesis follows from the passage?

  • The dispersed workload removes the need for validation because separate records cannot participate in any related database operation.
  • Concentrated requests should produce fewer validation conflicts because fewer distinct records need to be checked overall.
  • Their retry costs should be similar because the write proportion summarises the relevant opportunities for conflict.
  • Optimistic control could fare better in the dispersed workload because access patterns can reduce conflicts despite an unchanged write proportion.