The Wayback Machine - https://web.archive.org/web/20240713041624/https://www.geeksforgeeks.org/transaction-states-in-dbms/
Open In App

Transaction States in DBMS

Last Updated : 17 Jan, 2023
Improve
Improve
Like Article
Like
Save
Share
Report

States through which a transaction goes during its lifetime. These are the states which tell about the current state of the Transaction and also tell how we will further do the processing in the transactions. These states govern the rules which decide the fate of the transaction whether it will commit or abort. 

They also use Transaction log. Transaction log is a file maintain by recovery management component to record all the activities of the transaction. After commit is done transaction log file is removed. 

 

These are different types of Transaction States : 

 

  1. Active State – 
    When the instructions of the transaction are running then the transaction is in active state. If all the ‘read and write’ operations are performed without any error then it goes to the “partially committed state”; if any instruction fails, it goes to the “failed state”. 
     
  2. Partially Committed – 
    After completion of all the read and write operation the changes are made in main memory or local buffer. If the changes are made permanent on the DataBase then the state will change to “committed state” and in case of failure it will go to the “failed state”. 
     
  3. Failed State – 
    When any instruction of the transaction fails, it goes to the “failed state” or if failure occurs in making a permanent change of data on Data Base. 
     
  4. Aborted State – 
    After having any type of failure the transaction goes from “failed state” to “aborted state” and since in previous states, the changes are only made to local buffer or main memory and hence these changes are deleted or rolled-back. 
     
  5. Committed State – 
    It is the state when the changes are made permanent on the Data Base and the transaction is complete and therefore terminated in the “terminated state”. 
     
  6. Terminated State – 
    If there isn’t any roll-back or the transaction comes from the “committed state”, then the system is consistent and ready for new transaction and the old transaction is terminated. 
     

 



Similar Reads

Transaction Isolation Levels in DBMS
Prerequisite - Concurrency control in DBMS, ACID Properties in DBMS As we know, in order to maintain consistency in a database, it follows ACID properties. Among these four properties (Atomicity, Consistency, Isolation, and Durability) Isolation determines how transaction integrity is visible to other users and systems. It means that a transaction
5 min read
On Line Transaction Processing (OLTP) System in DBMS
On-Line Transaction Processing (OLTP) System refers to the system that manage transaction oriented applications. These systems are designed to support on-line transaction and process query quickly on the Internet. For example: POS (point of sale) system of any supermarket is a OLTP System. Every industry in today's world use OLTP system to record t
3 min read
Transaction Control in DBMS
The transaction is a single logical unit that accesses and modifies the contents of the database. Transactions access data using read and write operations. Transaction is a single operation of processing that can have many operations. Transaction is needed when more than one user wants to access same database. Transaction has ACID properties. ACID
5 min read
Transaction in DBMS
When the data of users is stored in a database, that data needs to be accessed and modified from time to time. This task should be performed with a specified set of rules and in a systematic way to maintain the consistency and integrity of the data present in a database. In DBMS, this task is called a transaction. It is similar to a bank transactio
10 min read
Difference between Secure Socket Layer (SSL) and Secure Electronic Transaction (SET)
Secure Socket Layer (SSL): Secure Socket Layer (SSL) is the normal security technology for establishing an associate encrypted link between an internet server and a browser. This link ensures that each knowledge passed between the online server and browsers stays personal and integral. SSL is associate trade normal and is employed by numerous websi
7 min read
Difference between Data Warehousing and Online transaction processing (OLTP)
1. Data Warehousing : Data Warehousing is a technique that gathers or collects data from different sources into a central repository, or, in other words, a single, complete, and consistent store of data that is obtained from different sources. It is a powerful database model that enhances the user ability to analyze huge, multidimensional datasets;
2 min read
Two Phase Commit Protocol (Distributed Transaction Management)
Consider we are given with a set of grocery stores where the head of all store wants to query about the available sanitizers inventory at all stores in order to move inventory store to store to make balance over the quantity of sanitizers inventory at all stores. The task is performed by a single transaction T that's component Tn at the nth store a
5 min read
Introduction to Transaction Processing
Single user system : In this at-most, only one user at a time can use the system. Multi-user system : In the same, many users can access the system concurrently. Concurrency can be provided through : Interleaved Processing - In this, the concurrent execution of processes is interleaved in a single CPU. The transactions are interleaved, meaning the
2 min read
Recovery from failures in Two Phase Commit Protocol (Distributed Transaction)
Prerequisite: Two-Phase Commit ProtocolIn the 2-phase commit protocol, the sites contributing to a distributed transaction and the coordinator that is managing the whole transaction globally may fail or crash, and this could lead to the whole transaction failure. Since unanimity is required in order to commit a distributed transaction successfully
4 min read
Transaction Management
Transactions are a set of operations used to perform a logical set of work. It is the bundle of all the instructions of a logical operation. A transaction usually means that the data in the database has changed. One of the major uses of DBMS is to protect the user's data from system failures. It is done by ensuring that all the data is restored to
8 min read