DBMS Lock-Based Protocol MCQs

DBMS Lock-Based Protocol MCQs: This section contains multiple-choice questions and answers on Lock-Based Protocol in DBMS.
Submitted by Anushree Goswami, on April 20, 2022

1. When using this type of protocol, each transaction must obtain a ___ on the data before it can read or write it.

  1. Lock
  2. Protocol
  3. Base
  4. Transaction

Answer: A) Lock

Explanation:

When using this type of protocol, each transaction must obtain a lock on the data before it can read or write it.

Discuss this Question


2. How many types of locks are there in this protocol?

  1. 2
  2. 3
  3. 4
  4. 5

Answer: A) 2

Explanation:

There are 2 types of locks in this protocol.

Discuss this Question


3. Which of the following is a type of lock?

  1. Shared lock
  2. Exclusive lock
  3. Both A and B
  4. None of the above

Answer: C) Both A and B

Explanation:

The following types of locks are there in this protocol -

  1. Shared lock
  2. Exclusive lock

Discuss this Question


4. What is a shared lock also known as?

  1. Share-only lock
  2. Read-only lock
  3. Write-only lock
  4. Fetch-only lock

Answer: B) Read-only lock

Explanation:

Shared lock is also known as Read-only lock.

Discuss this Question


5. Only the transaction can ___ the data item when the data item is locked in a shared lock.

  1. Read
  2. Write
  3. Share
  4. Fetch

Answer: A) Read

Explanation:

Only the transaction can read the data item when the data item is locked in a shared lock.

Discuss this Question


6. Since the transaction cannot update data on the data item when the shared lock is held, it can be shared ___ transactions.

  1. Before
  2. After
  3. Between
  4. None

Answer: C) Between

Explanation:

Since the transaction cannot update data on the data item when the lock is held, it can be shared between transactions.

Discuss this Question


7. The transaction can read as well as write the data item with a/an ___ lock.

  1. Shared
  2. Exclusive
  3. Read
  4. Write

Answer: B) Exclusive

Explanation:

The transaction can read as well as write the data item with an exclusive lock.

Discuss this Question


8. Multiple transactions cannot modify the same data simultaneously in the lock which is ___.

  1. Exclusive
  2. Write
  3. Read
  4. Shared

Answer: A) Exclusive

Explanation:

Multiple transactions cannot modify the same data simultaneously in this lock because it is exclusive.

Discuss this Question


9. How many types of lock protocols are there?

  1. 2
  2. 3
  3. 4
  4. 5

Answer: C) 4

Explanation:

There are 4 types of lock protocols.

Discuss this Question


10. Which of the following is a type of Lock Protocol?

  1. Simplistic Lock Protocol
  2. Pre-claiming Lock Protocol
  3. Two-phase locking
  4. All of the above

Answer: D) All of the above

Explanation:

The types of lock protocols are -

  1. Simplistic Lock Protocol
  2. Pre-claiming Lock Protocol
  3. Two-phase locking
  4. Strict Two-phase locking

Discuss this Question


11. All the transactions obtain a lock on the data before ___ it with simplistic lock-based protocols.

  1. Modifying
  2. Deleting
  3. Inserting
  4. All of the above

Answer: D) All of the above

Explanation:

All the transactions obtain a lock on the data before modifying, deleting, or inserting it with simplistic lock-based protocols.

Discuss this Question


12. What is TRUE about Pre-claiming lock protocol?

  1. In pre-claiming lock protocols, all items on which locks are needed are analyzed by evaluating the transaction.
  2. It requests the DBMS for a lock on all the data items before initiating the transaction.
  3. This protocol allows the transaction to begin if all the locks have been granted.
  4. All of the above

Answer: D) All of the above

Explanation:

In case of Pre-claiming lock protocol -

  1. In pre-claiming lock protocols, all items on which locks are needed are analyzed by evaluating the transaction.
  2. It requests the DBMS for a lock on all the data items before initiating the transaction.
  3. This protocol allows the transaction to begin if all the locks have been granted.

Discuss this Question


13. Lock-based protocols ___ transactions if not all locks are granted, and they wait until all locks are granted until the transaction can continue.

  1. Abort
  2. Commit
  3. Rollback
  4. End

Answer: C) Rollback

Explanation:

Lock-based protocols roll back transactions if not all locks are granted, and they wait until all locks are granted until the transaction can continue.

Discuss this Question


14. In how many parts does the Two-phase locking protocol divide the transaction's execution phase.

  1. 2
  2. 3
  3. 4
  4. 5

Answer: B) 3

Explanation:

During the execution phase of the transaction, two-phase locking divides the process into three parts.

Discuss this Question


15. What is TRUE about Two-phase locking?

  1. As long as the transaction is already running, it will try to obtain the required lock in the first part.
  2. As long as the transaction is already running, it will try to obtain the required lock in the second part.
  3. As long as the transaction is already running, it will try to obtain the required lock in the third part.
  4. As long as the transaction is already running, it will try to obtain the required lock in the fourth part.

Answer: A) As long as the transaction is already running, it will try to obtain the required lock in the first part.

Explanation:

As long as the transaction is already running, it will try to obtain the required lock in the first part.

Discuss this Question


16. The second part of the transaction involves the ___ of all the locks.

  1. Initialization
  2. Acquisition
  3. Termination
  4. None

Answer: B) Acquisition

Explanation:

The second part of the transaction involves the acquisition of all the locks.

Discuss this Question


17. Once the ___ lock is released, the third phase begins.

  1. First
  2. Second
  3. Middle
  4. Last

Answer: A) First

Explanation:

Once the first lock is released, the third phase begins.

Discuss this Question


18. The transaction ___ the acquired locks in the third phase.

  1. Attains
  2. Releases
  3. Adds
  4. Deletes

Answer: B) Releases

Explanation:

The transaction releases the acquired locks in the third phase.

Discuss this Question


19. How many phases of 2PL are there?

  1. 2
  2. 3
  3. 4
  4. 5

Answer: A) 2

Explanation:

There are 2 phases of 2PL.

Discuss this Question


20. What are the two phases of 2PL?

  1. Growing phase
  2. Shrinking phase
  3. Both A and B
  4. None of the above

Answer: C) Both A and B

Explanation:

The two phases of 2PL are -

  1. Growing phase
  2. Shrinking phase

Discuss this Question


21. The transaction may acquire a new lock on the data item during the ___ phase, but none can be released.

  1. Growing
  2. Shrinking
  3. Simplistic
  4. Pre-claiming

Answer: A) Growing

Explanation:

The transaction may acquire a new lock on the data item during the growing phase, but none can be released.

Discuss this Question


22. A transaction may be allowed to ___ its existing lock during the shrinking phase, but it cannot acquire any new locks.

  1. Delete
  2. Release
  3. Add
  4. Update

Answer: B) Release

Explanation:

A transaction may be allowed to release its existing lock during the shrinking phase, but it cannot acquire any new locks.

Discuss this Question


23. Strict-2PL follows the same process as ___ in that processing continues normally after all locks are acquired.

  1. Simplistic
  2. Pre-claiming
  3. 2PL
  4. None

Answer: C) 2PL

Explanation:

Strict-2PL follows the same process as 2PL in that processing continues normally after all locks are acquired.

Discuss this Question


24. What is the difference between 2PL and Strict-2PL?

  1. In Strict-2PL, locks are not released after use.
  2. In Strict-2PL, locks are not updated after use.
  3. In Strict-2PL, locks are not added after use.
  4. In Strict-2PL, locks are released after use.

Answer: A) In Strict-2PL, locks are not released after use.

Explanation:

The difference between 2PL and Strict-2PL is that in Strict-2PL, locks are not released after use.

Discuss this Question


25. The strict-2PL method waits until the entire transaction has been ___ before it releases all of the locks.

  1. Aborted
  2. Committed
  3. Rollbacked
  4. Updated

Answer: B) Committed

Explanation:

The strict-2PL method waits until the entire transaction has committed before it releases all of the locks.

Discuss this Question


26. A ___ phase of lock release is not part of the strict-2PL protocol.

  1. Growing
  2. Shrinking
  3. Both A and B
  4. None of the above

Answer: B) Shrinking

Explanation:

A shrinking phase of lock release is not part of the strict-2PL protocol.

Discuss this Question


27. There is no cascading ___ in strict-2PL as there is in 2PL.

  1. Commit
  2. Rollback
  3. End
  4. Abort

Answer: D) Abort

Explanation:

There is no cascading abort in strict-2PL as there is in 2PL.

Discuss this Question






Comments and Discussions!

Load comments ↻






Copyright © 2024 www.includehelp.com. All rights reserved.