The Wayback Machine - https://web.archive.org/web/20240708014559/https://www.geeksforgeeks.org/difference-between-conservative-and-rigorous-2-pl/
Open In App

Difference between Conservative and Rigorous 2-PL

Last Updated : 12 Aug, 2020
Improve
Improve
Like Article
Like
Save
Share
Report

Prerequisites – Two Phase Locking Protocol, and Categories of Two Phase Locking

1. Conservative 2-PL :

  • It is also called as Static 2-PL.
  • This protocol requires the transaction to lock all the items it access before the Transaction begins execution by pre-declaring its read-set and write-set.
  • If any of the pre-declared items needed cannot be locked, the transaction does not lock any of the items, instead, it waits until all the items are available for locking.

2. Rigorous 2-PL :

  • This requires that in addition to the lock being 2-Phase all Exclusive(X) and Shared(S) Locks held by the transaction be released until after the Transaction Commits.
  • Rigorous is more restrictive than Strict 2-PL.
  • The implementation of Rigorous 2-PL is easy.



Difference between Conservative and Rigorous 2-PL :

S.No. Conservative 2-PL Rigorous 2-PL
1. A transaction has to acquire locks on all the data items it requires before the transaction begins it execution. A transaction can acquire locks on data items whenever it requires (only in growing phase) during its execution.
2. It does not have a growing phase. It has a growing phase.
3. It has a shrinking phase. It does not have a shrinking phase.
4. It ensures that the schedule generated would be Serializable and Deadlock-Free. It ensures that the schedule generated would be Serializable, Recoverable and Cascadeless.
5. It does not ensures Recoverable and Cascadeless schedule. It does not ensures Deadlock-Free schedule.
6. It does not ensure Strict Schedule. It ensures that the schedule generated would be Strict.
7. It is not used in practise as its difficult to implement. It is easy to implement but a lighter version of it (i.e Strict 2-PL) is used in practise.
8. In Conservative 2-PL, a transaction can read a value of uncommitted transaction. In Rigorous 2-PL, a transaction only reads value of committed transaction.



Similar Reads

Categories of Two Phase Locking (Strict, Rigorous & Conservative)
Now that we are familiar with what is Two-Phase Locking (2-PL) and the basic rules which should be followed which ensures serializability. Moreover, we came across problems with 2-PL, Cascading Aborts, and Deadlocks. Now, we turn towards the enhancements made on 2-PL which try to make the protocol nearly error-free. Briefly, we allow some modificat
4 min read
Difference between Conservative and Strict 2PL
Prerequisites - Two Phase Locking Protocol and Types of Two Phase Locking Protocols 1. Conservative 2-PL : It is also known as Static 2-PL. This protocol requires the transaction to lock all the items it access before the transaction begins execution by pre-declaring its read-set and write-set. If any of the pre-declared items needed cannot be lock
2 min read
Difference between Difference Engine and Analytical Engine
Introduction: The development of computing technology has a rich history, with many inventions and innovations leading to the creation of the modern computer. Two such machines, the Difference Engine and Analytical Engine, were created by the English mathematician and inventor Charles Babbage in the 19th century. While these machines share some sim
7 min read
Difference between Voltage Drop and Potential Difference
Voltage Drop is defined as the decrease in the electric potential along the path of current that is flowing in an electric circuit. Voltage drop can be assigned at each point in the electric circuit that is proportional to the electrical elevation. The amount of energy delivered per second to any component in the circuit is equal to the voltage dro
4 min read
Difference Between Electric Potential and Potential Difference
The flow of electric charges is known as electricity, and it is responsible for producing electric current. An important word associated with electricity is electric potential. A potential difference is required to create the flow of electrons and hence, produce electricity. Before understanding the difference between electric potential and potenti
7 min read
Difference and Similarities between PHP and C
PHP is a server-side scripting language designed specifically for web development. It can be easily embedded in HTML files and HTML codes can also be written in a PHP file. The thing that differentiates PHP from a client-side language like HTML is, PHP codes are executed on the server whereas HTML codes are directly rendered on the browser. C is a
3 min read
Difference Between AND Gate and OR Gate
A logic gate is a simple switching circuit that determines whether an input pulse can pass through to the output in digital circuits. The building blocks of a digital circuit are logic gates, which execute numerous logical operations that are required by any digital circuit. These can take two or more inputs but produce only one output. The mix of
3 min read
Difference between Stop and Wait protocol and Sliding Window protocol
Introduction: Both Stop and Wait protocol and Sliding Window protocol are the techniques to the solution of flow control handling. The main difference between Stop-and-wait protocol and Sliding window protocol is that in Stop-and-Wait Protocol, the sender sends one frame and wait for acknowledgement from the receiver whereas in sliding window proto
4 min read
Similarities and Difference between Java and C++
Nowadays Java and C++ programming languages are vastly used in competitive coding. Due to some awesome features, these two programming languages are widely used in industries as well as comepetitive programming . C++ is a widely popular language among coders for its efficiency, high speed, and dynamic memory utilization. Java is widely used in the
6 min read
Difference between Time Tracking and Time and Attendance Software
Time tracking and time and attendance software are tools that help businesses track the time that employees spend on tasks and their attendance records. These tools can help businesses automate their time tracking processes, reduce errors and inaccuracies, and ensure that employees are paid accurately for the time they work. Time tracking software
4 min read