Database Management System 19: Transactions
Database Management System 19: Transactions
Database Management System 19: Transactions
Chittaranjan Pradhan
ACID Properties
Transactions
Chittaranjan Pradhan
School of Computer Engineering,
KIIT University
19.1
Transactions
Transaction Concept
Chittaranjan Pradhan
Transaction Concept
A transaction is a unit of program execution that accesses and Transaction Concept
Transaction States
19.2
Transactions
ACID Properties
Chittaranjan Pradhan
ACID Properties
Transaction Concept
• Atomicity: Either all operations of the transaction are ACID Properties
reflected properly in the database, or none are. Atomicity Transaction States
Transaction Concept
ACID Properties... ACID Properties
Transaction States
• Durability: After a transaction completes successfully, the
changes it has made to the database persist, even if there
are system failures. Durability ensures that once
transaction changes are done or committed, they can’t be
undone or lost, even in the event of a system failure
19.4
Transactions
ACID Properties...
Chittaranjan Pradhan
T1 Transaction States
Read(A);
A:=A-100;
Write(A);
Read(B);
B:=B+100;
Write(B);
19.5
Transactions
ACID Properties...
Chittaranjan Pradhan
2. Consistency: Sum of A and B be unchanged by the
execution of the transaction
Transaction Concept
• Ensuring the consistency for an individual transaction is
ACID Properties
the responsibility of the application programmers who Transaction States
codes the transaction
3. Isolation: The database is temporarily inconsistent while the
transaction to transfer funds from account A to B is executing.
The solutions are:
• Execute transactions serially
• However, concurrent execution of transactions provides
significant performance benefits such as increased
throughputs
• Ensuring the isolation property is the responsibility of
concurrency control component of the database system
4. Durability: Once a transaction completes successfully, all
the updates that is carried out on the database persist, even if
there is a system failure after the transaction completes
execution
• Ensuring durability is the responsibility of recovery
management component of the database system 19.6
Transactions
Transaction States
Chittaranjan Pradhan
• Active state: This state is the initial state of a transaction.
The transaction stays in this state while it is executing Transaction Concept
ACID Properties
Transaction Concept
ACID Properties
Transaction States