answersLogoWhite

0


Best Answer

2PC and 2PL are protocols used in conjunction with distributed databases. Both together are

The two phase lock protocol (2PL) deals uniquely with the fact how are locks are acquired during a transaction whereas the two phase commit (2PC) protocol deals with the fact how do multiple hosts decide wether one specific transaction is written (commited) or not (abort).

2PL sais that first there is a phase where locks are (during a transaction) acquired (growth phase) and then there is a phase where the locks are beeing removed (shrinking phase). Once the shrinking phase started no more locks can be acquired during this transaction. The shrinking phase usually takes place after an abort or a commit phase in a typical database system.

The essence of 2PC is that after a transaction is complete and should be commited a vote starts. Each node which is part of the transaction is asked to "prepare to commit". The node will then check wether a local commit is possible and if yes it votes with "ready to commit" (RTC) [Important: changes are not beeing written to the database at that point]. Once a node signaled RTC the system must be kept in a state where the transaction is allways commitable. If all nodes signal RTC the transaction the transaction master signals them a commit. If one of the nodes does not signal RTC the transaction master will signal abort to all local transactions.

User Avatar

Wiki User

13y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Difference between 2-phase locking and 2-phase commit?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is the difference between an undertaking and intentions?

Intending is when you hope to do something and undertaking is when you commit to something


Difference between roll back and commit in sql?

in sql commit is used for saving the changes made in database and roll back is to roll back them , changes will not get saved in the database


What is the difference between solicitation and conspiracy?

To solicit, means you are trying to get someone to commit a crime. Conspiricy means you and at least 2 other people agree to commit a crime, and then do something to move the crime foward.


Difference between 2-phase commit and 3-phase commit?

In a 2-phase commit protocol, there are two phases: prepare and commit. The coordinator asks all participants to prepare to commit, then all participants either agree or abort. In a 3-phase commit protocol, there are three phases: can-commit, pre-commit, and do-commit. This adds an extra phase to ensure better fault tolerance and improve the likelihood of reaching a decision.


What is the difference between married women and unmarried women?

Married women have someone they say they are committed to for life, while unmarried women are still searching for someone to marry or refuse to commit to anyone for a long period of time by choice.


Difference between criminal act and an act of delinquency?

the differnce between a criminal act and a delinquency act in school violance


What is the future tense of commit?

The future tense of "commit" is "will commit."


What is the difference between two phase commit and three phase commit in distributed system?

In a two-phase commit protocol, there are two phases: prepare and commit/abort. In the prepare phase, all participants agree to commit the transaction if no issues arise, and in the commit/abort phase, they carry out the agreed action. In a three-phase commit protocol, an additional phase called pre-commit is introduced between prepare and commit/abort phases to address some of the limitations of the two-phase commit protocol, such as the blocking problem.


Is commit a verb?

yes commit is a verb :) I commit this answer.


What is the difference between the act of murder and the intention of murder?

It is possible to commit the act of murder against someone without having had the INTENT to do so when you first confronted each other. However, if you went to the location KNOWING IN ADVANCE that you were going to kill him.... THAT is Intent.


What is the base word of commit?

The base word of "commit" is "commit."


What is the difference between unruly juvenile and delinquent juvenile?

A delinquent child can commit a crime that's illegal for someone over 18 (Ex: Murder) while an unruly juvenile commits a crime that's not illegal for someone over 18 (Ex: Smoking)