0% found this document useful (0 votes)
34 views29 pages

Database Presentation - 2

This document discusses transaction concepts and concurrent execution. It defines a transaction as a set of operations that perform a logical unit of work with ACID properties - atomicity, consistency, isolation, and durability. Transaction states are described as active, partially committed, committed, aborted, and failed. The document also discusses serial and non-serial schedules for concurrent transaction execution.

Uploaded by

Sabbir Ahmed
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views29 pages

Database Presentation - 2

This document discusses transaction concepts and concurrent execution. It defines a transaction as a set of operations that perform a logical unit of work with ACID properties - atomicity, consistency, isolation, and durability. Transaction states are described as active, partially committed, committed, aborted, and failed. The document also discusses serial and non-serial schedules for concurrent transaction execution.

Uploaded by

Sabbir Ahmed
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 29

Transactions - Serializability

Table of Contents
01 02
Introduction Transaction Concept

03 04
Transaction State Concurrent Execution!
Introduction
01
Team
190107 – Srijon Sarker
190108 – Md. Tosiqul Islam
190109 – Raj Adhikary
190110 – Sabbir Ahmed
190111 – Nishat Jahan Tandra
190112 – Hira Biswas
What is Transaction
Transaction:

It is a set of operations used to perform a logical unit of


works.
02
Transaction Concept
ACID Properties
Example
Transfer $50 from
Atomicity
A to B
1. read(A)
Consistency
2. A := A - 50
Isolation 3. write(A)
4. read(B)
Durability 5. B := B + 50
6. Write(B)
ACID Properties
Example
Transfer $50 from
Atomicity A to B
Either all operations of the operations 1. read(A)
or none of the operations will be 2. A := A - 50
reflected in the database 3. write(A)
4. read(B)
5. B := B + 50
6. Write(B)
ACID Properties Example
Transfer $50 from
A to B
Before transaction
Consistency A = 100, B = 50

Execution of a transaction in Total = 150


1. read(A)
isolation 2. A := A - 50
3. write(A)
4. read(B)
5. B := B + 50
6. Write(B)
ACID Properties Example
Transfer $50 from
A to B
T1 T2
Isolation 1. read(A)
2. A := A - 50
Multiple transaction may execute. 3. write(A)

Each transaction must be unaware of Read(A).read(B)


Print(A+B)
the concurrently executing 4. read(B)
5. B := B + 50
transaction. 6. Write(B)
ACID Properties
Example
Transfer $50 from
Durability A to B
1. read(A)
The change in database after
2. A := A - 50
completion of a successful transaction 3. write(A)

must be made even if there are system 4. read(B)


5. B := B + 50
failures
6. Write(B)
03
Transaction State
Example
Transfer $50 from
A to B
1. read(A)
2. A := A - 50
3. write(A)
4. read(B)
5. B := B + 50
6. Write(B)
States Partially
Partially
committed
committed committer
committed

Active
active

Transaction stays in this


state while it is executing failed aborted
aborted
States Partially
Partially
committed
committed committer
committed

Partially committed
active

After the final statement


has been executed failed aborted
aborted
States Partially
Partially
committed
committed committer
committed

Failed
Normal execution can no active

longer proceed failed aborted


aborted
States Partially
Partially
committed
committed committer

Aborted
After the transaction has been rolled active

back to database to its restored state,


• Restart the transaction failed aborted
aborted

• Kill the transaction


States Partially
Partially
committed
committed committed

Committed
After successful completion active

failed aborted
aborted
Concurrent Execution

04
Schedule

A sequence of instructions that specify the chronological order in which instructions of


concurrent transactions are executed
Serial Schedule

The serial schedule is a type of schedule


where one transaction is executed
completely before starting another
transaction.
Non-serial Schedule

In a non-serial Schedule, multiple


transactions execute
concurrently/simultaneously, unlike the
serial Schedule, where one transaction must
wait for another to complete all its
operations.
Schedule-3
Thank you

You might also like