SlideShare una empresa de Scribd logo
1 de 31
By C.Aruna (DSCASC) 1
Transaction Processing Concepts
Chapter 9
UNIT V
Data Base Management System
[DBMS]
By C.Aruna (DSCASC) 2
Intoduction
Transaction Processing Concepts
The concept of transaction :
 Provides a mechanism for describing logical units of database
processing.
Transaction processing systems :
 Systems with large databases and hundreds of concurrent users
that are executing database transactions.
By C.Aruna (DSCASC) 3
Single user Versus Multiuser Systems
Single-User: At most one user at a time can use the system
 Multi-User: Many users can use the system concurrently.
Multiprogramming: Allows the computer to execute multiple programs
at the same time.
Interleaving : Keeps the CPU busy when a process requires an input
or output operation, the CPU switched to execute another process rather
than remaining idle during I/O time .
Most of the theory concerning concurrency control in databases is
developed in terms of interleaved concurrency.
By C.Aruna (DSCASC) 4
Transactions, Read and Write Operations
A Transaction : is a logical unit of database processing, that includes one
or more database access operation.
All database access operations between Begin Transaction and End
Transaction statements are considered as one logical transaction.
If the database operations in a transaction do not update the database but
only retrieve data , the transaction is called a read-only transaction.
Basic database access operations :
read_item(X) : Reads a database item X into program variable.
write_item(X) : Writes the value of program variable X into the
database item X.
Read and Write Operations of a Transaction
 read_item(X): reads a database item named X into a program variable also
named X.
Execution of the command includes the following steps:
 find the address of the disk block that contains item X
 copy that disk block into a buffer in the main memory
 copy item X from the buffer to the program variable named X
 write_item(X): writes the value of program variable X into the database item
named X.
Execution of the command includes the following steps:
 find the address of the disk block that contains item X
 copy that disk block into a buffer in the main memory
 copy item X from the program variable named X into its current location in the buffer
 store the updated block in the buffer back to disk (this step updates the database on disk)
5By C.Aruna (DSCASC)
By C.Aruna (DSCASC) 6
Two sample transactions
a) Transaction T1
read_item(X);
X:=X-N;
write_item(X);
read_item(Y);
Y:=Y+N;
write_item(Y);
Transfer N reservations from
1st
flight to 2nd
flight
b) Transaction T2
read_item(x);
X:=X+M;
write_item(X);
Reserve M seats on the 1st
flight
X & Y refers to number of reserved seats for specific flight.
Transactions - examples
T1
Read-item(my-account)
my-account := my-account - 2000
Write-item(my-account)
Read-item(other-account)
Other-account := other-account + 2000
Write-item(other-account)
T2
Read-item(my-account)
my-account := my-account +1000
Write-item(my-account)
By C.Aruna (DSCASC) 7
Example T1: Rs.2000 is deducted from
my-account and added into other-account
Example T2: Rs.1000 is added to
my-account
By C.Aruna (DSCASC) 8
Why Concurrency Control is needed
Several problems can occur when concurrent transactions
execute in an uncontrolled manner.
Eg: Airlines reservation database.
Types of problems:
Types of problem occur when the two transaction run concurrently.
1) The Lost Update Problem.
2) The temporary Update (or Dirty read) problem.
3) The Incorrect Summary Problem.
4) Unrepeatable Read problem.
By C.Aruna (DSCASC) 9
Why Concurrency Control is needed
 The Lost Update Problem:
This problem occurs when two transactions access the
same database items concurrently.
T1 T2
Read_item(X);
X=:X-N;
Time
Read_item(X);
X=:X+M;
Write_item(X);
Read_item(Y);
Y=:Y+N; Write_item(X);
Item X has
incorrect
value because its
update by T1 is
“lost”
(overwritten)
Write_item(Y);
Pg:635 Navathe Eg. X=80 at the start, N=5 (T1 transfers 5 seat reservations from flight corresponding to
X to the flight corresponding to Y) & M=4
Ex: Lost update problem
T1
Read-item(my-account)
my-account := my-account – 2000
Write-item(my-account)
Read-item(other-account)
Other-account := other-account + 2000
Write-item(other-account)
T2
Read-item(my-account)
my-account := my-account +1000
Write-item(my-account)
By C.Aruna (DSCASC) 10
Example T1: Rs.2000 is deducted from
my-account
Example T2: Rs.1000 is added to
my-account
Time
By C.Aruna (DSCASC) 11
Why Concurrency Control is needed
 The temporary Update (or Dirty read) problem:
This problem occurs when one transaction updates a database item and
then the transaction fails for some reason. The update item is accessed by
another transaction before it is changed back to its original value.
T1 T2
Read_item(X);
X=:X-N;
write_item(X);
Time
Read_item(X);
X=:X+M;
write_item(X);read_item(Y);
Transaction T1 fails and must change
the value of X back to its old value,
meanwhile T2 has read the temporary
value ie. Incorrect value of X
Writing fails
before
completion.
Ex: Dirty read problem
T1
Read-item(my-account)
My-account := my-account - 2000
Write-item(my-account)
Read-item(other-account)
T2
Read-item(my-account)
My-account := my-account +1000
Write-item(my-account)
By C.Aruna (DSCASC) 12
Writing fails
before
completion.
Time
By C.Aruna (DSCASC) 13
Why Concurrency Control is needed (continued)
 The Incorrect Summary Problem:
If one transaction is calculating an aggregated summary function on
a number of records while other transaction are updating some of
these records, the aggregate function may calculate some values
before they are updated and others after they are updated.
By C.Aruna (DSCASC) 14
Why Concurrency Control is needed (continued)
3. The Incorrect Summary Problem:
T1 T3
Read_item(X);
X=:X-N;
write_item(X);
Time
Read_item(X);
sum:=sum+x;
read_item(Y);
sum:=sum+Y;
read_item(Y);
Y:=Y+N;
write_item(Y);
T3 reads X after N is
subtracted and reads Y
before N is added;
Sum:=0;
Read_item(A);
sum:=sum+A;
.
.
.
Ex: Incorrect Summary Problem
T1
Read-item(my-account1)
My-account1 := my-account1 - 2000
Write-item(my-account1)
Read-item(my-account2)
My-account2 := my-account2 + 2000
Write-item(my-account2)
T2
sum := 0
Read-item(my-account1)
sum := sum + my-account1
Read-item(my-account2)
sum := sum + my-account2
By C.Aruna (DSCASC) 15
Why Concurrency Control is needed (continued)
4. Unrepeatable Read problem: A transaction reads items twice with two
different values because it was changed by another transaction between
the two reads.
By C.Aruna (DSCASC) 16
T1
Read-item(my-account)
Read-item(my-account)
T2
Read-item(my-account)
My-account:= my-account + 1000
Write-item(my-account)
Eg: Bank, Flight Reservation – A customer enquires about seat availability in diff.
flights. When he decides to book, the no. of seats will be different because of T2
updates the no.of seats.
By C.Aruna (DSCASC) 17
Why Recovery Is Needed
There several possible reasons for a transaction to
fail
A computer failure : A hardware, software, or network error occurs in
the computer system during transaction execution.
A transaction or system error : Some operations in the transaction
may cause it to fail.
Local errors or exception conditions detected by the transaction.
By C.Aruna (DSCASC) 18
Why Recovery Is Needed (continued)
Concurrency control enforcement : The concurrency control method
may decide to abort the transaction.
Disk failure : all disk or some disk blocks may lose their data.
Physical problems : Disasters, theft, fire, etc.
The system must keep sufficient information to
recover from the failure.
By C.Aruna (DSCASC) 19
Transaction states and additional operations
A transaction is an atomic unit of work that is either completed
in its entirety or not done at all.
For recovery purposes the system needs to keep track of when
the transaction starts, terminates, and commits or aborts.
The recovery manager keeps track of the following operations :
BEGIN_TRANSACTION
READ OR WRITE
END_TRANSACTION
COMMIT_TRANSACTION
ROLLBACK
By C.Aruna (DSCASC) 20
Transaction states
BEGIN_TRANSACTION: This marks the beginning of transaction
execution.
READ OR WRITE: Specifies READ or WRITE transaction operations on
the database items that are executed as part of a transaction.
END_TRANSACTION: Specifies the READ and WRITE transaction
operations have ended and marks the end of transaction execution.
COMMIT_TRANSACTION: This signals a successful end of the transaction.
ROLLBACK (or ABORT): This signals that the transaction has ended
unsuccessfully, so that any changes or effects that the transaction may
have applied to the database must be undone.
By C.Aruna (DSCASC) 21
ACTIVE PARTIALLY
COMMITTED
FAILED TERMINATED
COMMITTED
BEGIN
TRANSACTION
END
TRANSACTION COMMIT
ABORT
ABORT
Figure 19.4 State transition diagram illustrating the states for transaction execution
READ/
WRITE
Transaction states
By C.Aruna (DSCASC) 22
Transaction states
 A state transition diagram that describes how a transaction moves through its
execution states.
 A transaction goes into active state immediately after it starts execution, where it
can issue READ and WRITE operations.
 When the transaction ends it moves to the partially committed state.
 At this point some recovery protocols need to ensure that a system failure will not
result in an inability to record the changes of the transaction permanently.
 Once this check is successful the transaction is said to have reached its commit point
and enters the committed state.
 A transaction can go to failed state if one of the checks fails or if the transaction is
aborted during its active state.
 The transaction may then have to be rolled back to undo the effect of its WRITE
operations on the database.
 The terminated state corresponds to the transaction leaving the system.
Properties of transactions
Properties of transactions:
ACID
 Atomicity
Consistency preservation
Isolation
 Durability
By C.Aruna (DSCASC) 23
By C.Aruna (DSCASC) 24
Properties of transactions
ACID should be enforced by the concurrency control and recovery
methods of the DBMS.
ACID properties of transactions :
Atomicity : a transaction is an atomic unit of processing; it is either
performed entirely or not performed at all.
(It is the responsibility of recovery)
Consistency : transfer the database from one consistent state to another
consistent state
(It is the responsibility of the applications and DBMS to maintain the
constraints)
By C.Aruna (DSCASC) 25
Properties of transactions (continued)
Isolation : the execution of the transaction should be isolated from
other transactions (Locking)
(It is the responsibility of concurrency)
* Isolation level:
- Level 0 (no dirty read) - Level 1 ( no lost update)
- Level 2 (no dirty+ no lost) - Level 3 (level 2+repeatable reads)
Durability : committed transactions must persist in the database ,i.e.
those changes must not be lost because of any failure.
(It is the responsibility of recovery)
• Atomicity
– Recovery system
• Consistency
– Programmer + DBMS
• Isolation
– Concurrency control
• Durability
– Recovery system
By C.Aruna (DSCASC) 26
Serial and serializability of schedules
• A schedule S is serial if in the operations in each
transaction in S are executed directly after each other.
• A schedule S is serializable if there is an equivalent
serial schedule S'.
• Equivalent: conflict equivalence
By C.Aruna (DSCASC) 27
Transactions
T1
Read-item(my-account)
My-account := my-account - 2000
Write-item(my-account)
Read-item(other-account)
Other-account := other-account + 2000
Write-item(other-account)
By C.Aruna (DSCASC) 28
T2
Read-item(my-account)
My-account := my-account +1000
Write-item(my-account)
Example of Serial Schedules
T1
Read-item(my-account)
My-account := my-account - 2000
Write-item(my-account)
Read-item(other-account)
Other-account := other-account + 2000
Write-item(other-account)
By C.Aruna (DSCASC) 29
T2
Read-item(my-account)
My-account := my-account +1000
Write-item(my-account)
Example of Serial Schedules
T1
Read-item(my-account)
My-account := my-account - 2000
Write-item(my-account)
Read-item(other-account)
Other-account := other-account + 2000
Write-item(other-account)
By C.Aruna (DSCASC) 30
T2
Read-item(my-account)
My-account := my-account +1000
Write-item(my-account)
Example of Non-serial Schedules
time
T1: T2:
read_item(X);
X:= X - N;
read_item(X);
X:= X + M;
write_item(X);
read_item(Y);
write_item(X);
Y:=Y + N;
write_item(Y);
Schedule A
31By C.Aruna (DSCASC)

Más contenido relacionado

La actualidad más candente

Memory & the fetch decode-execute cycle
Memory & the fetch decode-execute cycleMemory & the fetch decode-execute cycle
Memory & the fetch decode-execute cyclechantellemallia
 
Programming the basic computer
Programming the basic computerProgramming the basic computer
Programming the basic computerKamal Acharya
 
Communication in client server system.pptx
Communication in client server system.pptxCommunication in client server system.pptx
Communication in client server system.pptxMSivani
 
Lecture 4 principles of parallel algorithm design updated
Lecture 4   principles of parallel algorithm design updatedLecture 4   principles of parallel algorithm design updated
Lecture 4 principles of parallel algorithm design updatedVajira Thambawita
 
Unit 1 data representation and computer arithmetic
Unit 1  data representation and computer arithmeticUnit 1  data representation and computer arithmetic
Unit 1 data representation and computer arithmeticAmrutaMehata
 
Instruction Set Architecture (ISA)
Instruction Set Architecture (ISA)Instruction Set Architecture (ISA)
Instruction Set Architecture (ISA)Gaditek
 
UNIT I LINEAR DATA STRUCTURES – LIST
UNIT I 	LINEAR DATA STRUCTURES – LIST 	UNIT I 	LINEAR DATA STRUCTURES – LIST
UNIT I LINEAR DATA STRUCTURES – LIST Kathirvel Ayyaswamy
 
Unit 5 I/O organization
Unit 5   I/O organizationUnit 5   I/O organization
Unit 5 I/O organizationchidabdu
 
Data Dictionary in System Analysis and Design
Data Dictionary in System Analysis and DesignData Dictionary in System Analysis and Design
Data Dictionary in System Analysis and DesignArafat Hossan
 
INTERCONNECTION STRUCTURE
INTERCONNECTION STRUCTUREINTERCONNECTION STRUCTURE
INTERCONNECTION STRUCTUREVENNILAV6
 
Code generation in Compiler Design
Code generation in Compiler DesignCode generation in Compiler Design
Code generation in Compiler DesignKuppusamy P
 

La actualidad más candente (20)

Network layer logical addressing
Network layer logical addressingNetwork layer logical addressing
Network layer logical addressing
 
Memory & the fetch decode-execute cycle
Memory & the fetch decode-execute cycleMemory & the fetch decode-execute cycle
Memory & the fetch decode-execute cycle
 
Programming the basic computer
Programming the basic computerProgramming the basic computer
Programming the basic computer
 
Hashing PPT
Hashing PPTHashing PPT
Hashing PPT
 
Computer Organization
Computer OrganizationComputer Organization
Computer Organization
 
Communication in client server system.pptx
Communication in client server system.pptxCommunication in client server system.pptx
Communication in client server system.pptx
 
Lecture 4 principles of parallel algorithm design updated
Lecture 4   principles of parallel algorithm design updatedLecture 4   principles of parallel algorithm design updated
Lecture 4 principles of parallel algorithm design updated
 
Unit 1 data representation and computer arithmetic
Unit 1  data representation and computer arithmeticUnit 1  data representation and computer arithmetic
Unit 1 data representation and computer arithmetic
 
Instruction Set Architecture (ISA)
Instruction Set Architecture (ISA)Instruction Set Architecture (ISA)
Instruction Set Architecture (ISA)
 
Elmasri Navathe DBMS Unit-1 ppt
Elmasri Navathe DBMS Unit-1 pptElmasri Navathe DBMS Unit-1 ppt
Elmasri Navathe DBMS Unit-1 ppt
 
UNIT I LINEAR DATA STRUCTURES – LIST
UNIT I 	LINEAR DATA STRUCTURES – LIST 	UNIT I 	LINEAR DATA STRUCTURES – LIST
UNIT I LINEAR DATA STRUCTURES – LIST
 
Unit 5 I/O organization
Unit 5   I/O organizationUnit 5   I/O organization
Unit 5 I/O organization
 
Data Dictionary in System Analysis and Design
Data Dictionary in System Analysis and DesignData Dictionary in System Analysis and Design
Data Dictionary in System Analysis and Design
 
Computer arithmetic
Computer arithmeticComputer arithmetic
Computer arithmetic
 
INTERCONNECTION STRUCTURE
INTERCONNECTION STRUCTUREINTERCONNECTION STRUCTURE
INTERCONNECTION STRUCTURE
 
1s and 2s complement
1s and 2s complement1s and 2s complement
1s and 2s complement
 
Interrupt
InterruptInterrupt
Interrupt
 
Code generation in Compiler Design
Code generation in Compiler DesignCode generation in Compiler Design
Code generation in Compiler Design
 
Chapter 1
Chapter 1Chapter 1
Chapter 1
 
IPv4
IPv4IPv4
IPv4
 

Destacado

1. Introduction to DBMS
1. Introduction to DBMS1. Introduction to DBMS
1. Introduction to DBMSkoolkampus
 
Dbms ii mca-ch11-recovery-2013
Dbms ii mca-ch11-recovery-2013Dbms ii mca-ch11-recovery-2013
Dbms ii mca-ch11-recovery-2013Prosanta Ghosh
 
Dbms ii mca-ch1-ch2-intro-datamodel-2013
Dbms ii mca-ch1-ch2-intro-datamodel-2013Dbms ii mca-ch1-ch2-intro-datamodel-2013
Dbms ii mca-ch1-ch2-intro-datamodel-2013Prosanta Ghosh
 
Transaction management DBMS
Transaction  management DBMSTransaction  management DBMS
Transaction management DBMSMegha Patel
 
15. Transactions in DBMS
15. Transactions in DBMS15. Transactions in DBMS
15. Transactions in DBMSkoolkampus
 
Transactions in dbms
Transactions in dbmsTransactions in dbms
Transactions in dbmsNancy Gulati
 
Temporal Databases: Queries
Temporal Databases: QueriesTemporal Databases: Queries
Temporal Databases: Queriestorp42
 
Dbms ii mca-ch8-db design-2013
Dbms ii mca-ch8-db design-2013Dbms ii mca-ch8-db design-2013
Dbms ii mca-ch8-db design-2013Prosanta Ghosh
 
Dbms sixth chapter_part-1_2011
Dbms sixth chapter_part-1_2011Dbms sixth chapter_part-1_2011
Dbms sixth chapter_part-1_2011sumit_study
 
Dbms ii mca-ch7-sql-2013
Dbms ii mca-ch7-sql-2013Dbms ii mca-ch7-sql-2013
Dbms ii mca-ch7-sql-2013Prosanta Ghosh
 
Database ,10 Transactions
Database ,10 TransactionsDatabase ,10 Transactions
Database ,10 TransactionsAli Usman
 
Mobile Database
Mobile DatabaseMobile Database
Mobile DatabaseThanh Le
 
Record storage and primary file organization
Record storage and primary file organizationRecord storage and primary file organization
Record storage and primary file organizationJafar Nesargi
 
Dbms ii mca-ch10-concurrency-control-2013
Dbms ii mca-ch10-concurrency-control-2013Dbms ii mca-ch10-concurrency-control-2013
Dbms ii mca-ch10-concurrency-control-2013Prosanta Ghosh
 
Mobile database security threats
Mobile database security threatsMobile database security threats
Mobile database security threatsAkhil Kumar
 
Chapter 6 relational data model and relational
Chapter  6  relational data model and relationalChapter  6  relational data model and relational
Chapter 6 relational data model and relationalJafar Nesargi
 

Destacado (20)

1. Introduction to DBMS
1. Introduction to DBMS1. Introduction to DBMS
1. Introduction to DBMS
 
Dbms ii mca-ch11-recovery-2013
Dbms ii mca-ch11-recovery-2013Dbms ii mca-ch11-recovery-2013
Dbms ii mca-ch11-recovery-2013
 
Normalization case
Normalization caseNormalization case
Normalization case
 
Dbms ii mca-ch1-ch2-intro-datamodel-2013
Dbms ii mca-ch1-ch2-intro-datamodel-2013Dbms ii mca-ch1-ch2-intro-datamodel-2013
Dbms ii mca-ch1-ch2-intro-datamodel-2013
 
Transaction management DBMS
Transaction  management DBMSTransaction  management DBMS
Transaction management DBMS
 
15. Transactions in DBMS
15. Transactions in DBMS15. Transactions in DBMS
15. Transactions in DBMS
 
3 transaction
3 transaction3 transaction
3 transaction
 
Transactions in dbms
Transactions in dbmsTransactions in dbms
Transactions in dbms
 
Transaction states PPT
Transaction states PPTTransaction states PPT
Transaction states PPT
 
Temporal Databases: Queries
Temporal Databases: QueriesTemporal Databases: Queries
Temporal Databases: Queries
 
Dbms ii mca-ch8-db design-2013
Dbms ii mca-ch8-db design-2013Dbms ii mca-ch8-db design-2013
Dbms ii mca-ch8-db design-2013
 
Dbms sixth chapter_part-1_2011
Dbms sixth chapter_part-1_2011Dbms sixth chapter_part-1_2011
Dbms sixth chapter_part-1_2011
 
Ch16
Ch16Ch16
Ch16
 
Dbms ii mca-ch7-sql-2013
Dbms ii mca-ch7-sql-2013Dbms ii mca-ch7-sql-2013
Dbms ii mca-ch7-sql-2013
 
Database ,10 Transactions
Database ,10 TransactionsDatabase ,10 Transactions
Database ,10 Transactions
 
Mobile Database
Mobile DatabaseMobile Database
Mobile Database
 
Record storage and primary file organization
Record storage and primary file organizationRecord storage and primary file organization
Record storage and primary file organization
 
Dbms ii mca-ch10-concurrency-control-2013
Dbms ii mca-ch10-concurrency-control-2013Dbms ii mca-ch10-concurrency-control-2013
Dbms ii mca-ch10-concurrency-control-2013
 
Mobile database security threats
Mobile database security threatsMobile database security threats
Mobile database security threats
 
Chapter 6 relational data model and relational
Chapter  6  relational data model and relationalChapter  6  relational data model and relational
Chapter 6 relational data model and relational
 

Similar a Dbms ii mca-ch9-transaction-processing-2013

Introduction to transaction processing
Introduction to transaction processingIntroduction to transaction processing
Introduction to transaction processingJafar Nesargi
 
Chapter 9 introduction to transaction processing
Chapter 9 introduction to transaction processingChapter 9 introduction to transaction processing
Chapter 9 introduction to transaction processingJafar Nesargi
 
Chapter 9 introduction to transaction processing
Chapter 9 introduction to transaction processingChapter 9 introduction to transaction processing
Chapter 9 introduction to transaction processingJafar Nesargi
 
Introduction to transaction processing concepts and theory
Introduction to transaction processing concepts and theoryIntroduction to transaction processing concepts and theory
Introduction to transaction processing concepts and theoryZainab Almugbel
 
UNIT-IV: Transaction Processing Concepts
UNIT-IV: Transaction Processing ConceptsUNIT-IV: Transaction Processing Concepts
UNIT-IV: Transaction Processing ConceptsRaj vardhan
 
Recovery system
Recovery systemRecovery system
Recovery systemRakesh S
 
Transactionsmanagement
TransactionsmanagementTransactionsmanagement
TransactionsmanagementSanjeev Gupta
 
17. Recovery System in DBMS
17. Recovery System in DBMS17. Recovery System in DBMS
17. Recovery System in DBMSkoolkampus
 
database1.pptx
database1.pptxdatabase1.pptx
database1.pptxOmarKamil1
 
transaction mgr (7) (1).ppt
transaction mgr (7) (1).ppttransaction mgr (7) (1).ppt
transaction mgr (7) (1).pptPavanKumar980917
 
DBMS Unit III Material
DBMS Unit III MaterialDBMS Unit III Material
DBMS Unit III MaterialArthyR3
 
Transaction Management system.ppt
Transaction Management system.pptTransaction Management system.ppt
Transaction Management system.pptKaranKhurana54
 

Similar a Dbms ii mca-ch9-transaction-processing-2013 (20)

Unit 5
Unit 5Unit 5
Unit 5
 
Introduction to transaction processing
Introduction to transaction processingIntroduction to transaction processing
Introduction to transaction processing
 
Chapter 9 introduction to transaction processing
Chapter 9 introduction to transaction processingChapter 9 introduction to transaction processing
Chapter 9 introduction to transaction processing
 
Chapter 9 introduction to transaction processing
Chapter 9 introduction to transaction processingChapter 9 introduction to transaction processing
Chapter 9 introduction to transaction processing
 
Introduction to transaction processing concepts and theory
Introduction to transaction processing concepts and theoryIntroduction to transaction processing concepts and theory
Introduction to transaction processing concepts and theory
 
UNIT-IV: Transaction Processing Concepts
UNIT-IV: Transaction Processing ConceptsUNIT-IV: Transaction Processing Concepts
UNIT-IV: Transaction Processing Concepts
 
Recovery system
Recovery systemRecovery system
Recovery system
 
Transactionsmanagement
TransactionsmanagementTransactionsmanagement
Transactionsmanagement
 
17 Recovery system.ppt
17 Recovery system.ppt17 Recovery system.ppt
17 Recovery system.ppt
 
17. Recovery System in DBMS
17. Recovery System in DBMS17. Recovery System in DBMS
17. Recovery System in DBMS
 
Recovery system
Recovery systemRecovery system
Recovery system
 
Dbms
DbmsDbms
Dbms
 
database1.pptx
database1.pptxdatabase1.pptx
database1.pptx
 
Ch17
Ch17Ch17
Ch17
 
transaction mgr (7) (1).ppt
transaction mgr (7) (1).ppttransaction mgr (7) (1).ppt
transaction mgr (7) (1).ppt
 
DBMS Unit III Material
DBMS Unit III MaterialDBMS Unit III Material
DBMS Unit III Material
 
Aries
AriesAries
Aries
 
Transaction Management system.ppt
Transaction Management system.pptTransaction Management system.ppt
Transaction Management system.ppt
 
Transaction
TransactionTransaction
Transaction
 
DBMS UNIT 4
DBMS UNIT 4DBMS UNIT 4
DBMS UNIT 4
 

Último

SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number SystemsJheuzeDellosa
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 

Último (20)

SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number Systems
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 

Dbms ii mca-ch9-transaction-processing-2013

  • 1. By C.Aruna (DSCASC) 1 Transaction Processing Concepts Chapter 9 UNIT V Data Base Management System [DBMS]
  • 2. By C.Aruna (DSCASC) 2 Intoduction Transaction Processing Concepts The concept of transaction :  Provides a mechanism for describing logical units of database processing. Transaction processing systems :  Systems with large databases and hundreds of concurrent users that are executing database transactions.
  • 3. By C.Aruna (DSCASC) 3 Single user Versus Multiuser Systems Single-User: At most one user at a time can use the system  Multi-User: Many users can use the system concurrently. Multiprogramming: Allows the computer to execute multiple programs at the same time. Interleaving : Keeps the CPU busy when a process requires an input or output operation, the CPU switched to execute another process rather than remaining idle during I/O time . Most of the theory concerning concurrency control in databases is developed in terms of interleaved concurrency.
  • 4. By C.Aruna (DSCASC) 4 Transactions, Read and Write Operations A Transaction : is a logical unit of database processing, that includes one or more database access operation. All database access operations between Begin Transaction and End Transaction statements are considered as one logical transaction. If the database operations in a transaction do not update the database but only retrieve data , the transaction is called a read-only transaction. Basic database access operations : read_item(X) : Reads a database item X into program variable. write_item(X) : Writes the value of program variable X into the database item X.
  • 5. Read and Write Operations of a Transaction  read_item(X): reads a database item named X into a program variable also named X. Execution of the command includes the following steps:  find the address of the disk block that contains item X  copy that disk block into a buffer in the main memory  copy item X from the buffer to the program variable named X  write_item(X): writes the value of program variable X into the database item named X. Execution of the command includes the following steps:  find the address of the disk block that contains item X  copy that disk block into a buffer in the main memory  copy item X from the program variable named X into its current location in the buffer  store the updated block in the buffer back to disk (this step updates the database on disk) 5By C.Aruna (DSCASC)
  • 6. By C.Aruna (DSCASC) 6 Two sample transactions a) Transaction T1 read_item(X); X:=X-N; write_item(X); read_item(Y); Y:=Y+N; write_item(Y); Transfer N reservations from 1st flight to 2nd flight b) Transaction T2 read_item(x); X:=X+M; write_item(X); Reserve M seats on the 1st flight X & Y refers to number of reserved seats for specific flight.
  • 7. Transactions - examples T1 Read-item(my-account) my-account := my-account - 2000 Write-item(my-account) Read-item(other-account) Other-account := other-account + 2000 Write-item(other-account) T2 Read-item(my-account) my-account := my-account +1000 Write-item(my-account) By C.Aruna (DSCASC) 7 Example T1: Rs.2000 is deducted from my-account and added into other-account Example T2: Rs.1000 is added to my-account
  • 8. By C.Aruna (DSCASC) 8 Why Concurrency Control is needed Several problems can occur when concurrent transactions execute in an uncontrolled manner. Eg: Airlines reservation database. Types of problems: Types of problem occur when the two transaction run concurrently. 1) The Lost Update Problem. 2) The temporary Update (or Dirty read) problem. 3) The Incorrect Summary Problem. 4) Unrepeatable Read problem.
  • 9. By C.Aruna (DSCASC) 9 Why Concurrency Control is needed  The Lost Update Problem: This problem occurs when two transactions access the same database items concurrently. T1 T2 Read_item(X); X=:X-N; Time Read_item(X); X=:X+M; Write_item(X); Read_item(Y); Y=:Y+N; Write_item(X); Item X has incorrect value because its update by T1 is “lost” (overwritten) Write_item(Y); Pg:635 Navathe Eg. X=80 at the start, N=5 (T1 transfers 5 seat reservations from flight corresponding to X to the flight corresponding to Y) & M=4
  • 10. Ex: Lost update problem T1 Read-item(my-account) my-account := my-account – 2000 Write-item(my-account) Read-item(other-account) Other-account := other-account + 2000 Write-item(other-account) T2 Read-item(my-account) my-account := my-account +1000 Write-item(my-account) By C.Aruna (DSCASC) 10 Example T1: Rs.2000 is deducted from my-account Example T2: Rs.1000 is added to my-account Time
  • 11. By C.Aruna (DSCASC) 11 Why Concurrency Control is needed  The temporary Update (or Dirty read) problem: This problem occurs when one transaction updates a database item and then the transaction fails for some reason. The update item is accessed by another transaction before it is changed back to its original value. T1 T2 Read_item(X); X=:X-N; write_item(X); Time Read_item(X); X=:X+M; write_item(X);read_item(Y); Transaction T1 fails and must change the value of X back to its old value, meanwhile T2 has read the temporary value ie. Incorrect value of X Writing fails before completion.
  • 12. Ex: Dirty read problem T1 Read-item(my-account) My-account := my-account - 2000 Write-item(my-account) Read-item(other-account) T2 Read-item(my-account) My-account := my-account +1000 Write-item(my-account) By C.Aruna (DSCASC) 12 Writing fails before completion. Time
  • 13. By C.Aruna (DSCASC) 13 Why Concurrency Control is needed (continued)  The Incorrect Summary Problem: If one transaction is calculating an aggregated summary function on a number of records while other transaction are updating some of these records, the aggregate function may calculate some values before they are updated and others after they are updated.
  • 14. By C.Aruna (DSCASC) 14 Why Concurrency Control is needed (continued) 3. The Incorrect Summary Problem: T1 T3 Read_item(X); X=:X-N; write_item(X); Time Read_item(X); sum:=sum+x; read_item(Y); sum:=sum+Y; read_item(Y); Y:=Y+N; write_item(Y); T3 reads X after N is subtracted and reads Y before N is added; Sum:=0; Read_item(A); sum:=sum+A; . . .
  • 15. Ex: Incorrect Summary Problem T1 Read-item(my-account1) My-account1 := my-account1 - 2000 Write-item(my-account1) Read-item(my-account2) My-account2 := my-account2 + 2000 Write-item(my-account2) T2 sum := 0 Read-item(my-account1) sum := sum + my-account1 Read-item(my-account2) sum := sum + my-account2 By C.Aruna (DSCASC) 15
  • 16. Why Concurrency Control is needed (continued) 4. Unrepeatable Read problem: A transaction reads items twice with two different values because it was changed by another transaction between the two reads. By C.Aruna (DSCASC) 16 T1 Read-item(my-account) Read-item(my-account) T2 Read-item(my-account) My-account:= my-account + 1000 Write-item(my-account) Eg: Bank, Flight Reservation – A customer enquires about seat availability in diff. flights. When he decides to book, the no. of seats will be different because of T2 updates the no.of seats.
  • 17. By C.Aruna (DSCASC) 17 Why Recovery Is Needed There several possible reasons for a transaction to fail A computer failure : A hardware, software, or network error occurs in the computer system during transaction execution. A transaction or system error : Some operations in the transaction may cause it to fail. Local errors or exception conditions detected by the transaction.
  • 18. By C.Aruna (DSCASC) 18 Why Recovery Is Needed (continued) Concurrency control enforcement : The concurrency control method may decide to abort the transaction. Disk failure : all disk or some disk blocks may lose their data. Physical problems : Disasters, theft, fire, etc. The system must keep sufficient information to recover from the failure.
  • 19. By C.Aruna (DSCASC) 19 Transaction states and additional operations A transaction is an atomic unit of work that is either completed in its entirety or not done at all. For recovery purposes the system needs to keep track of when the transaction starts, terminates, and commits or aborts. The recovery manager keeps track of the following operations : BEGIN_TRANSACTION READ OR WRITE END_TRANSACTION COMMIT_TRANSACTION ROLLBACK
  • 20. By C.Aruna (DSCASC) 20 Transaction states BEGIN_TRANSACTION: This marks the beginning of transaction execution. READ OR WRITE: Specifies READ or WRITE transaction operations on the database items that are executed as part of a transaction. END_TRANSACTION: Specifies the READ and WRITE transaction operations have ended and marks the end of transaction execution. COMMIT_TRANSACTION: This signals a successful end of the transaction. ROLLBACK (or ABORT): This signals that the transaction has ended unsuccessfully, so that any changes or effects that the transaction may have applied to the database must be undone.
  • 21. By C.Aruna (DSCASC) 21 ACTIVE PARTIALLY COMMITTED FAILED TERMINATED COMMITTED BEGIN TRANSACTION END TRANSACTION COMMIT ABORT ABORT Figure 19.4 State transition diagram illustrating the states for transaction execution READ/ WRITE Transaction states
  • 22. By C.Aruna (DSCASC) 22 Transaction states  A state transition diagram that describes how a transaction moves through its execution states.  A transaction goes into active state immediately after it starts execution, where it can issue READ and WRITE operations.  When the transaction ends it moves to the partially committed state.  At this point some recovery protocols need to ensure that a system failure will not result in an inability to record the changes of the transaction permanently.  Once this check is successful the transaction is said to have reached its commit point and enters the committed state.  A transaction can go to failed state if one of the checks fails or if the transaction is aborted during its active state.  The transaction may then have to be rolled back to undo the effect of its WRITE operations on the database.  The terminated state corresponds to the transaction leaving the system.
  • 23. Properties of transactions Properties of transactions: ACID  Atomicity Consistency preservation Isolation  Durability By C.Aruna (DSCASC) 23
  • 24. By C.Aruna (DSCASC) 24 Properties of transactions ACID should be enforced by the concurrency control and recovery methods of the DBMS. ACID properties of transactions : Atomicity : a transaction is an atomic unit of processing; it is either performed entirely or not performed at all. (It is the responsibility of recovery) Consistency : transfer the database from one consistent state to another consistent state (It is the responsibility of the applications and DBMS to maintain the constraints)
  • 25. By C.Aruna (DSCASC) 25 Properties of transactions (continued) Isolation : the execution of the transaction should be isolated from other transactions (Locking) (It is the responsibility of concurrency) * Isolation level: - Level 0 (no dirty read) - Level 1 ( no lost update) - Level 2 (no dirty+ no lost) - Level 3 (level 2+repeatable reads) Durability : committed transactions must persist in the database ,i.e. those changes must not be lost because of any failure. (It is the responsibility of recovery)
  • 26. • Atomicity – Recovery system • Consistency – Programmer + DBMS • Isolation – Concurrency control • Durability – Recovery system By C.Aruna (DSCASC) 26
  • 27. Serial and serializability of schedules • A schedule S is serial if in the operations in each transaction in S are executed directly after each other. • A schedule S is serializable if there is an equivalent serial schedule S'. • Equivalent: conflict equivalence By C.Aruna (DSCASC) 27
  • 28. Transactions T1 Read-item(my-account) My-account := my-account - 2000 Write-item(my-account) Read-item(other-account) Other-account := other-account + 2000 Write-item(other-account) By C.Aruna (DSCASC) 28 T2 Read-item(my-account) My-account := my-account +1000 Write-item(my-account)
  • 29. Example of Serial Schedules T1 Read-item(my-account) My-account := my-account - 2000 Write-item(my-account) Read-item(other-account) Other-account := other-account + 2000 Write-item(other-account) By C.Aruna (DSCASC) 29 T2 Read-item(my-account) My-account := my-account +1000 Write-item(my-account)
  • 30. Example of Serial Schedules T1 Read-item(my-account) My-account := my-account - 2000 Write-item(my-account) Read-item(other-account) Other-account := other-account + 2000 Write-item(other-account) By C.Aruna (DSCASC) 30 T2 Read-item(my-account) My-account := my-account +1000 Write-item(my-account)
  • 31. Example of Non-serial Schedules time T1: T2: read_item(X); X:= X - N; read_item(X); X:= X + M; write_item(X); read_item(Y); write_item(X); Y:=Y + N; write_item(Y); Schedule A 31By C.Aruna (DSCASC)