Generally, there are three types of schedule given as follows:
1. Recoverable Schedule –
A schedule is said to be recoverable if it is recoverable as name suggest. Only reads are allowed before write operation on same data. Only reads (Ti->Tj) is permissible.
S1: R1(x), W1(x), R2(x), R1(y), R2(y), W2(x), W1(y), C1, C2;
Given schedule follows order of Ti->Tj => C1->C2. Transaction T1 is executed before T2 hence there is no chances of conflict occur. R1(x) appears before W1(x) and transaction T1 is committed before T2 i.e. completion of first transaction performed first update on data item x, hence given schedule is recoverable.
Lets see example of unrecoverable schedule to clear the concept more:
S2: R1(x), R2(x), R1(z), R3(x), R3(y), W1(x), W3(y), R2(y), W2(z), W2(y), C1, C2, C3;
Ti->Tj => C2->C3 but W3(y) executed before W2(y) which leads to conflicts thus it must be committed before T2 transaction. So given schedule is unrecoverable. if Ti->Tj => C3->C2 is given in schedule then it will become recoverable schedule.
Note: A committed transaction should never be rollback. It means that reading value from uncommitted transaction and commit it will enter the current transaction into inconsistent or unrecoverable state this is called Dirty Read problem.
2. Cascadeless Schedule –
When no read or write-write occurs before execution of transaction then corresponding schedule is called cascadeless schedule.
S3: R1(x), R2(z), R3(x), R1(z), R2(y), R3(y), W1(x), C1, W2(z), W3(y), W2(y), C3, C2;
In this schedule W3(y) and W2(y) overwrite conflicts and there is no read, therefore given schedule is cascadeless schedule.
Special Case –
A committed transaction desired to abort. As given below all the transactions are reading committed data hence it’s cascadeless schedule.
3. Strict Schedule –
if schedule contains no read or write before commit then it is known as strict schedule. Strict schedule is strict in nature.
S4: R1(x), R2(x), R1(z), R3(x), R3(y), W1(x), C1, W3(y), C3, R2(y), W2(z), W2(y), C2;
In this schedule no read-write or write-write conflict arises before commit hence its strict schedule:
4. Cascading Abort –
Cascading Abort can also be rollback. If transaction T1 abort as T2 read data that written by T1 which is not committed. Hence it’s cascading rollback.
Corelation between Strict, Cascadeless and Recoverable schedule:
From above figure:
- Strict schedules are all recoverable and cascadeless schedules
- All cascadeless schedules are recoverable
- Types of Schedules in DBMS
- Recoverability in DBMS
- Log based Recovery in DBMS
- Validation Based Protocol in DBMS
- Graph Based Concurrency Control Protocol in DBMS
- Lock Based Concurrency Control Protocol in DBMS
- Types of OLAP Systems in DBMS
- Difference between Memory based and Register based Addressing Modes
- Process-based and Thread-based Multitasking
- Timestamp based Concurrency Control
- Best College Prediction based on GATE CS All India Rank (AIR)/Score
- Cryptography and its Types
- Types of Routing
- Types of Operating Systems
- Neo4j | Values and Types
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.