Computer Science, asked by dawitbirr11, 1 year ago

Explain working principles of 2 phase locking and 3 phase locking

Answers

Answered by siddhartharao77
5

2-phase locking:

(i) It is a concurrency control method which divides the execution phase of a transaction into three parts.

(ii) There are two phases:

(a) Growing Phase

⇒ Transaction may obtain locks.

⇒ Transaction may not release locks.


(b) Shrinking phase

⇒ Transaction may release locks.

⇒ Transaction may not obtain locks.

Disadvantages:

⇒ Performance Issues.

⇒ State Inconsistency


3-Phase locking:

(i) It is designed as a non-blocking protocol as a contrary to the 2PC.

(ii) A new phase is introduced, known as pre-commit phase, in between the voting phase and global decision phase.


Disadvantages

(i) Multiple site failures.


Hope it helps!

Similar questions