Classify concurrency anomaly between two transactions
Problem Description
Consider two transactions, T1 and T2, executing concurrently and accessing the same data item, A. Their operations occur in the following chronological order:
T1reads the initial value ofA, which is100.T2also reads the initial value ofA, which is100.T1performs a write operation, updatingAtoA + 10. Conceptually,T1intends to write110.T2performs a write operation, updatingAtoA - 10.T2uses its previously read value of100, so it conceptually intends to write90.
Given this sequence of operations, which description best characterizes the concurrency problem observed?
Options
- A. This operation cannot be repeatably read (non-repeatable read).
- B. This operation has no problems.
- C. This operation reads dirty data.
- D. This operation loses modifications (lost update).
AI interview prep
Core dilemma
Ensuring data integrity and correctness when multiple transactions attempt to modify the same data item concurrently based on potentially stale reads, leading to an update being overwritten and effectively 'lost'.
2 tradeoffs and 2 stress tests locked
Interview prep
Unlock the interviewer X-Ray rubric, tradeoff matrix, stress tests, clarifying questions, and key concepts.
Classify concurrency anomaly between two transactions
Problem Description
Consider two transactions, T1 and T2, executing concurrently and accessing the same data item, A. Their operations occur in the following chronological order:
T1reads the initial value ofA, which is100.T2also reads the initial value ofA, which is100.T1performs a write operation, updatingAtoA + 10. Conceptually,T1intends to write110.T2performs a write operation, updatingAtoA - 10.T2uses its previously read value of100, so it conceptually intends to write90.
Given this sequence of operations, which description best characterizes the concurrency problem observed?
Options
- A. This operation cannot be repeatably read (non-repeatable read).
- B. This operation has no problems.
- C. This operation reads dirty data.
- D. This operation loses modifications (lost update).