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

12y 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 2-phase commit and 3-phase commit?

Check on this link for answer : http://www.hypergurl.com/blog/databases/two-phase-protocol.html


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.


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."


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 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)


What is the difference between cheating husband to cheating wife?

Cheating is cheating no matter if the woman is married or single. The only difference is the man involved feels he can have a wild affair with a married woman without commitment because she will most likely stay with her spouse and the man cheating will stay with his spouse, but if he should have an affair with a single woman she may want him to leave his wife and commit to her.


How do you spell the word commit?

Commit