RDBMS Questions and Answers – Lock Based Protocols

This set of RDBMS Multiple Choice Questions & Answers (MCQs) focuses on “Lock Based Protocols”.

1. If a transaction has obtained a __________ lock, it can read but cannot write on the item
a) Shared mode
b) Exclusive mode
c) Read only mode
d) Write only mode
View Answer

Answer: a
Explanation: If a transaction Ti has obtained a shared-mode lock (denoted by S) on item Q, then Ti can read, but cannot write, Q.

2. If a transaction has obtained a ________ lock, it can both read and write on the item
a) Shared mode
b) Exclusive mode
c) Read only mode
d) Write only mode
View Answer

Answer: b
Explanation: If a transaction has obtained an exclusive mode lock, then it can both read and write on the item on which it in operating.

3. A transaction can proceed only after the concurrency control manager ________ the lock to the transaction
a) Grants
b) Requests
c) Allocates
d) None of the mentioned
View Answer

Answer: a
Explanation: A transaction can proceed only after the concurrency control manager grants the lock to the transaction.
advertisement
advertisement

4. If a transaction can be granted a lock on an item immediately in spite of the presence of another mode, then the two modes are said to be ________
a) Concurrent
b) Equivalent
c) Compatible
d) Executable
View Answer

Answer: c
Explanation: If a transaction can be granted a lock on an item immediately in spite of the presence of another mode, then the two modes are said to be compatible.

5. A transaction is made to wait until all ________ locks held on the item are released
a) Compatible
b) Incompatible
c) Concurrent
d) Equivalent
View Answer

Answer: a
Explanation: A transaction is made to wait until all compatible locks held on the item are released. This ensures that no other transaction is concurrently accessing the same item.
Note: Join free Sanfoundry classes at Telegram or Youtube

6. State true or false: It is not necessarily desirable for a transaction to unlock a data item immediately after its final access
a) True
b) False
View Answer

Answer: a
Explanation: It is not necessarily desirable for a transaction to unlock a data item immediately after its final access because serializability may be violated due to this.

7. The situation where no transaction can proceed with normal execution is known as ________
a) Road block
b) Deadlock
c) Execution halt
d) Abortion
View Answer

Answer: b
Explanation: The situation where no transaction can proceed with normal execution is known as a deadlock.
advertisement

8. The protocol that indicates when a transaction may lock and unlock each of the data items is called as __________
a) Locking protocol
b) Unlocking protocol
c) Granting protocol
d) Conflict protocol
View Answer

Answer: a
Explanation: The protocol that indicates when a transaction may lock and unlock each of the data items is called as locking protocol. Locking protocols restrict the number of schedules.

9. If a transaction Ti may never make progress, then the transaction is said to be ____________
a) Deadlocked
b) Starved
c) Committed
d) Rolled back
View Answer

Answer: b
Explanation: If a transaction Ti may never make progress, then the transaction is said to be starved.
advertisement

10. The two phase locking protocol consists which of the following phases?
a) Growing phase
b) Shrinking phase
c) More than one of the mentioned
d) None of the mentioned
View Answer

Answer: c
Explanation: The two phased locking protocol consists of the growing phase and the shrinking phase.

11. If a transaction may obtain locks but may not release any locks then it is in _______ phase
a) Growing phase
b) Shrinking phase
c) Deadlock phase
d) Starved phase
View Answer

Answer: a
Explanation: If a transaction may obtain locks but may not release any locks then it is in growing phase. Growing phase is a phase in two phased locking protocol.

12. If a transaction may release locks but may not obtain any locks, it is said to be in ______ phase
a) Growing phase
b) Shrinking phase
c) Deadlock phase
d) Starved phase
View Answer

Answer: b
Explanation: If a transaction may release locks but may not obtain any locks, it is said to be in shrinking phase. Shrinking phase is a phase in two phased locking protocol.

Sanfoundry Global Education & Learning Series – RDBMS.

To practice all areas of RDBMS, here is complete set of 1000+ Multiple Choice Questions and Answers.

If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.