0% found this document useful (0 votes)
36 views5 pages

3 Tranactions (Book Chapter 9)

A transaction is defined as a logical unit of work that must be completed in its entirety or not at all to maintain data consistency. It consists of one or more operations that modify the database. For example, selling an item requires adding it to a sold items list and removing it from a stock items list - both operations must succeed for the transaction to be committed. Transactions have properties known as ACID to ensure reliability - Atomicity, Consistency, Isolation, and Durability.

Uploaded by

MUNEEBA GUL
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)
36 views5 pages

3 Tranactions (Book Chapter 9)

A transaction is defined as a logical unit of work that must be completed in its entirety or not at all to maintain data consistency. It consists of one or more operations that modify the database. For example, selling an item requires adding it to a sold items list and removing it from a stock items list - both operations must succeed for the transaction to be committed. Transactions have properties known as ACID to ensure reliability - Atomicity, Consistency, Isolation, and Durability.

Uploaded by

MUNEEBA GUL
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/ 5

Transaction

Dr. Engr. Sami ur Rahman


Transaction

 A transaction is defined as a logical unit work.


 It consist of one or more operations on a database that must be
completed together so that the database remains in a consistent state.
 A transaction must either complete successfully or fail.

Stock Sold
item list items list

 After selling an item, it must be added in the sold items list (one
operation) and it should be subtracted from the stock items list (second
operation).
 Both of these operations together make up a single transcation.
 Both must complete successfully or both mus fail.
University Of Malakand | Department of Computer Science | Visual Computing Research Group | Dr. Engr.Sami ur Rahman 2 of 6
Commit and Rollback

 A transaction is committed if it completes successfully and changes the


data.
 If it fails and leaves the data unchanged, it is said that the transaction
has been rolled back.
 The rollback is used to undo the work done in the current transaction.

University Of Malakand | Department of Computer Science | Visual Computing Research Group | Dr. Engr.Sami ur Rahman 3 of 6
Transaction Properties (ACID Properties)

 If programmers guarantee correctness of individual transactions, then


DBMS guarantees correctness of any set of them
 A transaction must have four properties called ACID (Atomicity,
Consistency, Isolation, Durability) properties.
 (Failure) Atomicity: A transaction must completely succeed or
completely fail.
 Consistency: A transaction must leave the data in consistent state after
completion. For example, in a bank database, money should never be
created or deleted without an appropriate deposit or withdrawal.
 Isolation: All transaction that modify the data are isolated from each
other. They do not access the same data at the same time. Transaction
must have no dependence or effect on other transactions.
 Durability—The modification made by a transaction are permanent and
persistent. If the same is crashed or rebooted, data should be
guaranteed to be completed when the computer restarts.

University Of Malakand | Department of Computer Science | Visual Computing Research Group | Dr. Engr.Sami ur Rahman 4 of 6
Thanks for your attention

University Of Malakand | Department of Computer Science | Visual Computing Research Group | Dr. Engr.Sami ur Rahman 5 of 6

You might also like