Question 21
EasyHow does a lock timeout help with deadlocks?
- A.
It deletes the locked rows
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
DBMS
How does a lock timeout help with deadlocks?
It deletes the locked rows
A transaction that waits longer than a set time is rolled back
It makes locks last forever
It doubles the waiting time
Sign up free to see the answer and a step-by-step explanation.
What does a row-level lock lock?
The whole database
The server's CPU
Only the individual rows being used
The whole table
Sign up free to see the answer and a step-by-step explanation.
What does a table-level lock lock?
The entire table
Only the index
Only one column
Only one row
Sign up free to see the answer and a step-by-step explanation.
Why do row-level locks usually allow more concurrency than table-level locks?
Rows are smaller than tables on disk
Transactions working on different rows of the same table don't block each other
Row locks never cause deadlocks
Row locks need no lock manager
Sign up free to see the answer and a step-by-step explanation.
What does it mean for a schedule to be serialisable?
It never uses locks
Its effect is the same as that of some serial (one-after-another) schedule
It runs transactions in alphabetical order
It contains only one transaction
Sign up free to see the answer and a step-by-step explanation.
What is a recoverable schedule?
One stored on disk
One with no transactions
One that can be printed
One in which a transaction commits only after every transaction it read data from has committed
Sign up free to see the answer and a step-by-step explanation.
Which kind of lock does a transaction need before updating a row?
A shared (read) lock
An exclusive (write) lock
No lock at all
A lock on the whole database
Sign up free to see the answer and a step-by-step explanation.
What is two-phase locking (2PL)?
A transaction acquires all its locks in a growing phase and releases them in a shrinking phase, never acquiring after releasing
Using two kinds of locks only
Locking each item twice
Locking in two databases
Sign up free to see the answer and a step-by-step explanation.
How does strict 2PL differ from basic 2PL?
Only shared locks are used
Exclusive locks are held until the transaction commits or aborts
There is no growing phase
Locks are released immediately after use
Sign up free to see the answer and a step-by-step explanation.
When is a schedule conflict-serialisable?
When it has a cycle in its precedence graph
When its precedence (serialisation) graph has no cycle
When it uses no locks
When transactions never read data
Sign up free to see the answer and a step-by-step explanation.