CS FundamentalsHardProduct-company MCQ pattern
Strict two-phase locking (Strict 2PL) differs from basic 2PL in which way?
- A. It allows locks to be released at any point, like basic 2PL
- B. It holds ALL exclusive (write) locks until the transaction commits or aborts, eliminating cascading rollback (a transaction never reads data written by another transaction that might still abort)
- C. It removes the growing phase entirely
- D. It only applies to read locks, not write locks
Correct answer: B. It holds ALL exclusive (write) locks until the transaction commits or aborts, eliminating cascading rollback (a transaction never reads data written by another transaction that might still abort)
Basic 2PL guarantees conflict-serializability but still allows a transaction to release a write lock before committing, which can let another transaction read that (possibly-to-be-rolled-back) data and cascade the rollback. Strict 2PL holds exclusive locks until commit/abort, so nothing uncommitted is ever visible for others to build on, eliminating cascading rollbacks.
More DBMS and SQL questions
- Rigorous two-phase locking (Rigorous 2PL) goes one step further than Strict 2PL. What extra guarantee does it add?
- Multiple Granularity Locking uses intention locks (IS, IX, SIX) on coarser objects like a table, in addition to ordinary shared/exclusive…
- A foreign key column is declared ON DELETE CASCADE. If the referenced (parent) row is deleted, what happens to the child rows referencing…
- A schema uses salary DECIMAL(8,2) for a salary column. Which value would be REJECTED when inserted?
- A column is declared VARCHAR(10) vs. CHAR(10). For a value like 'cat' (3 characters), which statement is correct about storage and…
- A query planner chooses a full table scan over using an available index on a WHERE column. Which scenario makes this the RIGHT choice, not…