Transaction
By : Ayush Agrawal
Data Base management system
2
Introduction to TRANSACTION
Transactions refer to a set of
operations that are used for
performing a set of logical
work. Usually, a transaction
means the data present in
the DB has changed.
Protecting the user data
from system failures is one
of the primary uses of
DBMS.
3
A user can make different types of requests to
access and modify the contents of a database. So,
we have different types of operations relating to
a transaction.
Operations of transaction
• i) Read(X)
A read operation
is used to read
the value of X
from the
database and
store it in a buffer
in the main
memory for
further actions
such as
displaying that
value.
• ii) Write(X)
A write operation is
used to write the
value to the
database from the
buffer in the main
memory. For a
write operation to
be performed, first
a read operation is
performed to bring
its value in buffer,
and then some
changes are made
to it.
• iii) Commit
Due to some failure of
power, hardware, or
software, etc., a
transaction might get
interrupted before all its
operations are
completed. To ensure
that further operations of
any other transaction
are performed only after
work of the current
transaction is done, a
commit operation is
performed to the
changes made by a
transaction permanently
to the database.
• iv) Rollback
This operation is
performed to
bring the
database to the
last saved state
when any
transaction is
interrupted in
between due to
any power,
hardware, or
software failure.
4
Transaction Schedules
When multiple transaction requests are made at the same time,
we need to decide their order of execution. Thus, a transaction
schedule can be defined as a chronological order of execution of
multiple transactions.
There are broadly two types of transaction schedules
Serial
Schedule
Non-Serial
Schedule
5
i) Serial Schedule
• In this kind of schedule, when multiple transactions are to be executed, they
are executed serially, i.e. At one time only one transaction is executed while
others wait for the execution of the current transaction to be completed.
This ensures consistency in the database as transactions do not execute
simultaneously.
• But, it increases the waiting time of the transactions in the queue, which in
turn lowers the throughput of the system, i.e. Number of transactions
executed per time.
• To improve the throughput of the system, another kind of schedule are used
which has some more strict rules which help the database to remain
consistent even when transactions execute simultaneously.
6
ii) Non-Serial Schedule
To reduce the waiting time of transactions in the waiting queue
and improve the system efficiency, we use non serial schedules
which allow multiple transactions to start before a transaction is
completely executed. This may sometimes result in inconsistency
and errors in database operation.
So, these errors are handled with specific algorithms to maintain
the consistency of the database and improve CPU throughput as
well.
• Non-serial schedules are also sometimes referred to as parallel
schedules, as transactions execute in parallel in these kinds of
schedules.
Subject Code
7
TYPES OF TRANSACTIONS
• Read-only Transactions:
• Only retrieves data without making any changes.
• Update Transactions:
• Modifies existing data in the database.
• Insert Transactions:
• Adds new records to the database.
• Delete Transactions:
• Removes data from the database.
• Complex Transactions:
• Includes multiple types of operations in a single transaction.
8
States of transaction
A transaction is a series of operations, so various states
occur in its completion journey.
TRANSACTION STATES
• Active:
• The transaction is being executed.
• Partially Committed:
• After the final operation is executed, but before the transaction is committed.
• Committed:
• The transaction has been successfully completed and changes are saved
permanently.
• Failed:
• If any error occurs during execution, the transaction enters this state.
• Aborted:
• The transaction has been rolled back due to an error, and the database is restored
to its previous state.
10
Properties of transaction
As transactions deal with
accessing and modifying the
contents of the database, they
must have some basic properties
which help maintain the
consistency and integrity of the
database before and after the
transaction. Transactions follow 4
properties, namely, Atomicity,
Consistency, Isolation, and
Durability.
Generally, these are referred to as
ACID properties of transactions in
DBMS.
ATOMICITY
This property ensures
that either all
operations of a
transaction are
executed or it is
aborted. In any
case, a transaction
can never be
completed partially.
CONSISTENCY
This property of a
transaction keeps
the database
consistent before
and after a
transaction is
completed.
ISOLATION
This property states that two
transactions must not
interfere with each other, i.e.
If some data is used by a
transaction for its execution,
then any other transaction
can not concurrently
access that data until the
first transaction has
completed.
DURABILITY
This property
ensures that the
changes made to
the database after
a transaction is
completely
executed, are
durable.
Subject Code
11
CONCURRENCY CONTROL
• Concurrency control ensures that multiple transactions can execute
in parallel without conflicting with each other.
• Techniques include:
• Locking: Locks data to prevent other transactions from accessing it
simultaneously.
• Timestamp Ordering: Assigns timestamps to transactions and processes
them in timestamp order.
• Optimistic Concurrency Control: Allows transactions to execute without
restrictions and checks for conflicts at commit time.
Subject Code
12
TRANSACTION RECOVERY
• Recovery ensures that the database is restored to a
consistent state after a failure (e.g., power loss, system crash).
• Techniques:
• Rollback: If a transaction fails, it is rolled back to its original state.
• Write-Ahead Logging (WAL): Logs are written to disk before the
actual transaction data is committed to ensure recovery.
• Shadow Paging: Uses a backup copy of the database pages to
roll back if necessary
13
Conclusion
Transactions in DBMS are pivotal in maintaining the
integrity and consistency of the database through a
series of well-defined operations and states. From the
initial execution of operations to handling errors and
ensuring consistency, transactions must adhere to the
ACID properties—Atomicity, Consistency, Isolation,
and Durability. These properties guarantee that
transactions are processed reliably and that the
database remains stable even in the face of failures or
concurrent operations.

More Related Content

PPTX
Unit 4 chapter - 8 Transaction processing Concepts (1).pptx
PPTX
TRANSACTION MANAGEMENT PROCESSING DBMS(5)
PPTX
E-Business Information System BBA AVI.pptx
PDF
Advanced database chapter three PowerPoint
PPTX
Presentation on Transaction
PPTX
Unit no 5 transation processing DMS 22319
PPTX
DBMS-Module - 5 updated1onestructure of database.pptx
PPTX
Introduction to transaction management
Unit 4 chapter - 8 Transaction processing Concepts (1).pptx
TRANSACTION MANAGEMENT PROCESSING DBMS(5)
E-Business Information System BBA AVI.pptx
Advanced database chapter three PowerPoint
Presentation on Transaction
Unit no 5 transation processing DMS 22319
DBMS-Module - 5 updated1onestructure of database.pptx
Introduction to transaction management

Similar to Transation in data base management system.pptx (20)

PPT
transaction_processing.ppt
DOC
What is Database Backup? The 3 Important Recovery Techniques from transaction...
PPTX
FALLSEM2023-24_BCSE302L_TH_VL2023240100957_2023-06-21_Reference-Material-I.pptx
PPTX
Transaction processing
PPTX
UNIT II in the part of Database at the PG
PDF
chp13.pdf
PPTX
Presentation on Transaction Processing in DBMS
PPT
Transaction management and concurrency control
PPTX
transaction in dbms.pptx aktu syllabusss
PPTX
Dartabase Transaction.pptx
PPTX
transcation processing the concept of dbms
PPTX
DBMS UNIT 4
PDF
DATABASE MANAGEMENT SYSTEMS-BTECH-UNIT-4.pdf
PPT
Dbms sixth chapter_part-1_2011
PPTX
Transaction Processing Concept
PPTX
Understanding Transactions in Databases.pptx
PPT
Chapter 4 u
PPTX
DBMS Session 6 Transactions Management and Concurrency Control.pptx
PDF
DBMS-chap 2-Concurrency Control
transaction_processing.ppt
What is Database Backup? The 3 Important Recovery Techniques from transaction...
FALLSEM2023-24_BCSE302L_TH_VL2023240100957_2023-06-21_Reference-Material-I.pptx
Transaction processing
UNIT II in the part of Database at the PG
chp13.pdf
Presentation on Transaction Processing in DBMS
Transaction management and concurrency control
transaction in dbms.pptx aktu syllabusss
Dartabase Transaction.pptx
transcation processing the concept of dbms
DBMS UNIT 4
DATABASE MANAGEMENT SYSTEMS-BTECH-UNIT-4.pdf
Dbms sixth chapter_part-1_2011
Transaction Processing Concept
Understanding Transactions in Databases.pptx
Chapter 4 u
DBMS Session 6 Transactions Management and Concurrency Control.pptx
DBMS-chap 2-Concurrency Control
Ad

Recently uploaded (20)

PPTX
1 hour to get there before the game is done so you don’t need a car seat for ...
PPTX
Sheep Seg. Marketing Plan_C2 2025 (1).pptx
PPTX
indiraparyavaranbhavan-240418134200-31d840b3.pptx
PPTX
Capstone Presentation a.pptx on data sci
PDF
technical specifications solar ear 2025.
PPTX
research framework and review of related literature chapter 2
PDF
The Role of Pathology AI in Translational Cancer Research and Education
PDF
General category merit rank list for neet pg
PPTX
ifsm.pptx, institutional food service management
PDF
REPORT CARD OF GRADE 2 2025-2026 MATATAG
PPTX
DIGITAL DESIGN AND.pptx hhhhhhhhhhhhhhhhh
PPTX
inbound6529290805104538764.pptxmmmmmmmmm
PPTX
Machine Learning and working of machine Learning
PPTX
865628565-Pertemuan-2-chapter-03-NUMERICAL-MEASURES.pptx
PPTX
Introduction to Fundamentals of Data Security
PPTX
langchainpptforbeginners_easy_explanation.pptx
PPTX
Hushh Hackathon for IIT Bombay: Create your very own Agents
PPT
dsa Lec-1 Introduction FOR THE STUDENTS OF bscs
PDF
Mcdonald's : a half century growth . pdf
PPTX
Chapter security of computer_8_v8.1.pptx
1 hour to get there before the game is done so you don’t need a car seat for ...
Sheep Seg. Marketing Plan_C2 2025 (1).pptx
indiraparyavaranbhavan-240418134200-31d840b3.pptx
Capstone Presentation a.pptx on data sci
technical specifications solar ear 2025.
research framework and review of related literature chapter 2
The Role of Pathology AI in Translational Cancer Research and Education
General category merit rank list for neet pg
ifsm.pptx, institutional food service management
REPORT CARD OF GRADE 2 2025-2026 MATATAG
DIGITAL DESIGN AND.pptx hhhhhhhhhhhhhhhhh
inbound6529290805104538764.pptxmmmmmmmmm
Machine Learning and working of machine Learning
865628565-Pertemuan-2-chapter-03-NUMERICAL-MEASURES.pptx
Introduction to Fundamentals of Data Security
langchainpptforbeginners_easy_explanation.pptx
Hushh Hackathon for IIT Bombay: Create your very own Agents
dsa Lec-1 Introduction FOR THE STUDENTS OF bscs
Mcdonald's : a half century growth . pdf
Chapter security of computer_8_v8.1.pptx
Ad

Transation in data base management system.pptx

  • 1. Transaction By : Ayush Agrawal Data Base management system
  • 2. 2 Introduction to TRANSACTION Transactions refer to a set of operations that are used for performing a set of logical work. Usually, a transaction means the data present in the DB has changed. Protecting the user data from system failures is one of the primary uses of DBMS.
  • 3. 3 A user can make different types of requests to access and modify the contents of a database. So, we have different types of operations relating to a transaction. Operations of transaction • i) Read(X) A read operation is used to read the value of X from the database and store it in a buffer in the main memory for further actions such as displaying that value. • ii) Write(X) A write operation is used to write the value to the database from the buffer in the main memory. For a write operation to be performed, first a read operation is performed to bring its value in buffer, and then some changes are made to it. • iii) Commit Due to some failure of power, hardware, or software, etc., a transaction might get interrupted before all its operations are completed. To ensure that further operations of any other transaction are performed only after work of the current transaction is done, a commit operation is performed to the changes made by a transaction permanently to the database. • iv) Rollback This operation is performed to bring the database to the last saved state when any transaction is interrupted in between due to any power, hardware, or software failure.
  • 4. 4 Transaction Schedules When multiple transaction requests are made at the same time, we need to decide their order of execution. Thus, a transaction schedule can be defined as a chronological order of execution of multiple transactions. There are broadly two types of transaction schedules Serial Schedule Non-Serial Schedule
  • 5. 5 i) Serial Schedule • In this kind of schedule, when multiple transactions are to be executed, they are executed serially, i.e. At one time only one transaction is executed while others wait for the execution of the current transaction to be completed. This ensures consistency in the database as transactions do not execute simultaneously. • But, it increases the waiting time of the transactions in the queue, which in turn lowers the throughput of the system, i.e. Number of transactions executed per time. • To improve the throughput of the system, another kind of schedule are used which has some more strict rules which help the database to remain consistent even when transactions execute simultaneously.
  • 6. 6 ii) Non-Serial Schedule To reduce the waiting time of transactions in the waiting queue and improve the system efficiency, we use non serial schedules which allow multiple transactions to start before a transaction is completely executed. This may sometimes result in inconsistency and errors in database operation. So, these errors are handled with specific algorithms to maintain the consistency of the database and improve CPU throughput as well. • Non-serial schedules are also sometimes referred to as parallel schedules, as transactions execute in parallel in these kinds of schedules.
  • 7. Subject Code 7 TYPES OF TRANSACTIONS • Read-only Transactions: • Only retrieves data without making any changes. • Update Transactions: • Modifies existing data in the database. • Insert Transactions: • Adds new records to the database. • Delete Transactions: • Removes data from the database. • Complex Transactions: • Includes multiple types of operations in a single transaction.
  • 8. 8 States of transaction A transaction is a series of operations, so various states occur in its completion journey.
  • 9. TRANSACTION STATES • Active: • The transaction is being executed. • Partially Committed: • After the final operation is executed, but before the transaction is committed. • Committed: • The transaction has been successfully completed and changes are saved permanently. • Failed: • If any error occurs during execution, the transaction enters this state. • Aborted: • The transaction has been rolled back due to an error, and the database is restored to its previous state.
  • 10. 10 Properties of transaction As transactions deal with accessing and modifying the contents of the database, they must have some basic properties which help maintain the consistency and integrity of the database before and after the transaction. Transactions follow 4 properties, namely, Atomicity, Consistency, Isolation, and Durability. Generally, these are referred to as ACID properties of transactions in DBMS. ATOMICITY This property ensures that either all operations of a transaction are executed or it is aborted. In any case, a transaction can never be completed partially. CONSISTENCY This property of a transaction keeps the database consistent before and after a transaction is completed. ISOLATION This property states that two transactions must not interfere with each other, i.e. If some data is used by a transaction for its execution, then any other transaction can not concurrently access that data until the first transaction has completed. DURABILITY This property ensures that the changes made to the database after a transaction is completely executed, are durable.
  • 11. Subject Code 11 CONCURRENCY CONTROL • Concurrency control ensures that multiple transactions can execute in parallel without conflicting with each other. • Techniques include: • Locking: Locks data to prevent other transactions from accessing it simultaneously. • Timestamp Ordering: Assigns timestamps to transactions and processes them in timestamp order. • Optimistic Concurrency Control: Allows transactions to execute without restrictions and checks for conflicts at commit time.
  • 12. Subject Code 12 TRANSACTION RECOVERY • Recovery ensures that the database is restored to a consistent state after a failure (e.g., power loss, system crash). • Techniques: • Rollback: If a transaction fails, it is rolled back to its original state. • Write-Ahead Logging (WAL): Logs are written to disk before the actual transaction data is committed to ensure recovery. • Shadow Paging: Uses a backup copy of the database pages to roll back if necessary
  • 13. 13 Conclusion Transactions in DBMS are pivotal in maintaining the integrity and consistency of the database through a series of well-defined operations and states. From the initial execution of operations to handling errors and ensuring consistency, transactions must adhere to the ACID properties—Atomicity, Consistency, Isolation, and Durability. These properties guarantee that transactions are processed reliably and that the database remains stable even in the face of failures or concurrent operations.