1. TOPICS Covered = Designations in IT Companies ,Colleges ,MNC’s
,Govt. Sectors ,Business .
Prepared By:- Sunny Saini
Asst. Professor
LKCW, Jalandhar City
Email: sunnysaini090@gmail.com
Website: www.techz.tk
2. What is a Transaction?
“A transaction is a smallest unit of program
execution .”
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
Saving Account
Rs.5000 TO 3000
Loan Account
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. Atomicity
C. Consistency
I. Isolation
D. Durability
6. Atomicity
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.
Consistency
A transaction must preserve the consistency of a database
after the execution.
Isolation
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.
7. Durability
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
subsequent failures.
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
preceed.
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.
11. CONCURRENCY AND
CONCURRENCY CONTROL
“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
control.
13. Advantages of Concurrency
Control
*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
another transaction.
*Reduced Waiting TimeInterleaved execution of a
short transaction with a long transaction
Usually allows the short transaction to complete
quickly.