Question 51
MediumIn optimistic (validation-based) concurrency control, when are conflicts checked?
- A.
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
DBMS
In optimistic (validation-based) concurrency control, when are conflicts checked?
At the end, just before commit
Before every read
Before the transaction starts
Never
Sign up free to see the answer and a step-by-step explanation.
When does optimistic concurrency control perform best?
Never
When transactions are very long and write-heavy
When conflicts between transactions are rare
When most transactions update the same row
Sign up free to see the answer and a step-by-step explanation.
Under MVCC, why don't readers block writers?
Writers wait for all readers
Reads are not allowed during writes
Readers see an older committed version while the writer creates a new one
Readers take exclusive locks
Sign up free to see the answer and a step-by-step explanation.
Which problem does a predicate (range) lock or index-range lock prevent?
Dirty writes only
Disk failures
Phantom reads
Lost updates only
Sign up free to see the answer and a step-by-step explanation.
Schedule: r1(A), r2(A), w1(A), w2(A) (r = read, w = write, the number is the transaction). Is it conflict-serialisable?
It is serial
Yes — it is equivalent to T2 then T1
No — the precedence graph has the cycle T1 → T2 → T1
Yes — it is equivalent to T1 then T2
Sign up free to see the answer and a step-by-step explanation.
Schedule: r1(A), w1(A), r2(A), w2(A), r1(B), w1(B), r2(B), w2(B). Which serial schedule is it conflict-equivalent to?
T2 then T1
Both
Neither
T1 then T2
Sign up free to see the answer and a step-by-step explanation.
In the wait-die scheme, an older transaction requests a lock held by a younger one. What happens?
The older transaction waits
Both are aborted
The older transaction is aborted
The younger transaction is aborted
Sign up free to see the answer and a step-by-step explanation.
In the wound-wait scheme, a younger transaction requests a lock held by an older one. What happens?
The older transaction is aborted
The younger transaction waits
The younger transaction is aborted
The lock is shared
Sign up free to see the answer and a step-by-step explanation.
Which problem can two-phase locking NOT prevent on its own?
Lost updates
Non-serialisable schedules
Deadlock
Inconsistent reads
Sign up free to see the answer and a step-by-step explanation.
What does Thomas's write rule allow in timestamp ordering?
Writes need no timestamps
Every write is applied immediately
Reads can see uncommitted writes
An outdated write (older than the item's last write) is ignored instead of aborting the transaction
Sign up free to see the answer and a step-by-step explanation.