Open In App

Cascading Rollback

Last Updated : 12 Mar, 2024
Improve
Improve
Like Article
Like
Save
Share
Report

Cascading rollback is a term that is used in DBMS. It is a concept that is explained in DBMS when we start discussing transactions.

So, let’s discuss briefly the basics that we require to know before studying cascading rollback.

What is DBMS?

DBMS refers to a Database management system. We can also say that it is the manager of our databases in our computer system.

It is software that is used to create and manage the databases in our computer systems. It requires knowledge of different query languages for database management and creation such as SQL, NoSQL, PostgreSQL etc. The database is nothing but a collection of data in a particular space like a computer or server.

What is a Transaction?

Transaction can be defined as the logical set of operations that are performed on the databases. It is similar to the transactions that are done by us in our daily lives. An example of a transaction in DBMS can be seen below.

T1

T2

                   Read(A)  
                   A=A-1000  
                   Write(A)  
Read(B)  
                   B=B+1000                    Read(A)
                   Write(B)                    Temp=A*0.01
                   commit                    A=A-temp
                     Write(A)
  Read(B)
                     B=B+ temp
                     Write(B)
                     commit

ACID Properties

Transactions follows the acid properties which is a short form of Atomicity, Consistency, Isolation, Durability (ACID).The Acid properties of transaction are defined below:

1. Atomicity

We can remember about this using a single line that is, “Either full or none”. It means that a transaction will either execute all operations or none i.e. either a transaction will get completed or it will not take place. It is maintained using recovery subsystem.

2. Consistency

It means that our database should be consistent throughout the transaction. It is maintained by either by user or programmer. We can see the consistency in the below mentioned example.

Example:

Consider two persons A and B

Balance in A’s account = 1000;

Balance in B’s account = 500 ;

Sum of A and B account balance = 1500;

Now consider if A transfers 100 rupees to B then their new balance will be

A’s account balance = 900;

B’s account balance = 600;

Sum of A and B account balance after transfer = 1500

So, from the above example we can say that the total amount in A and B account remained consistent throughout the transaction.

3. Isolation

The word isolation in general means, “The state of being separate or alone”. In DBMS Two or more transaction in parallel execution will take place separately or independently. It is maintained using concurrency system.  

4. Durability

It is derived from the word durable which means, “likely to last for a long time”. The modification done in the database during a transaction should stay for a long period of time. It should remain the same even if the system fails. It is maintained using  recovery subsystem. When a transaction takes place it goes through a number of states.

What are Schedules?

Schedules are defined as, Time order sequence of two or more transaction.

What is Rollback?

If transaction is failed then we have recovery management system. With the help of rollback , transaction recovery will take place. The rollback will take place with the help of transaction logs. logs are the file that keeps a record of all the activity which is done by the transaction. The rollback undo all the modifications that has taken place during a transaction. 

What is Cascading Rollback?

It is formed using two different words which are cascade and Rollback. The word cascade means, “waterfall” and rollback means, “ an act of making an action to change back to what it was before”. Due to the failure of a single transaction a cascade of transaction rollbacks. This is known as cascading rollback. For instance we can refer to the below mentioned transaction.

                 T1                 T2                      T3
         Read(A)    
         Read(B)    
         Write(A)    
             Read(A)  
             Write(A)  
                    Read(A)
         abort    

Frequently Asked Questions on Cascading Rollback

What role do transaction logs play in Rollback?

Transaction logs record all activities in a transaction, allowing the rollback process to undo modifications and recover from transaction failures.

What is the difference between Rollback and Commit in DBMS transactions?

Rollback in DBMS cancels or undoes a transaction’s changes, while Commit finalizes a transaction, making its changes permanent.



Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads