1. TOPICS Covered = Designations in IT Companies ,Colleges ,MNC’s
,Govt. Sectors ,Business .
Prepared By:- Sunny Saini
LKCW, Jalandhar City
2. What is a Transaction?
“A transaction is a smallest unit of program
It is a set of changes that must all be made together . It
is a program unit whose execution may or may not
change the contents of the database.transaction is
executed as a single unit.
Transaction consists of definite number of steps:
3. For Example
A tranfer of money from one bank account to other
bank account can be treated as transaction.
4. Concept of a Transaction
Rs.5000 TO 3000
Rs.5000 to 7000
5. Transaction Properties
There are four important properties of transaction
that a DBMS must ensure to maintain data in the
case of concurrent access and system failures.
These are also called as ACID properties:
A transaction is said to be atomic if a transaction always
executes all its actions in one step or donot execute any
action at all.
A transaction must preserve the consistency of a database
after the execution.
The transaction must behave as if they are executed in
isolation.it means that if several transactions are executed
concurrently the results must be same as if they were
executed serially in same order.
The effect of completed or committed transactions
should persist even after a crash.it means once a
transaction commits , the system must guarantee that
the result of its operations will never be lost,inspite of
8. Transaction States
Through out the life cycle of a transaction, the
transaction must be in one of the following states:
1.Activethis is the initial state ,the transaction stays
in this state while it is executing.
2.Partially CommittedA transaction is in the state
when it has executed the final statement.
3.Failedwhen the normal execution can no longer
9. 4.AbortedAfter the transaction has been rolled back
and the database has been restored to its state prior
to the start of the transaction.
5.CommittedAfter successful completion.
10. Transaction States
11. CONCURRENCY AND
“Allowing multiple transactions to run concurrently on
the same database is called Concurrency.”
Feature of Concurrency is available due to the multi-
programming features of operating systems.
12. “Concurrency control is the process of regulating
access to the same data by multiple transactions
operating in the same database environment.”
Consider what can happen if two or more concurrent
users access the same data without any concurrency
13. Advantages of Concurrency
*Improved Throughputconsider that transaction
are performed in serial order and active transaction is
waiting for a page to be read in from disk ,then
instead of CPU waiting for a page ,it can process
*Reduced Waiting TimeInterleaved execution of a
short transaction with a long transaction
Usually allows the short transaction to complete
14. Disadvantages of Concurrency
-Lost update Problem
-The temporary Update (uncommited
-The incorrect Summary(inconsistent analysis)Problem
15. Concurrency Control Schemes
Concurrency control schemes are divided into two
Pessimistic or Conservative Approach