Category: Entertainment

Presentation Description

No description available.


Presentation Transcript


TRANSACTION MANAGEMENT Presented by p. Chandra sekhar Roll no :(30) There are three side effects of acid. Enhanced long term memory, decreased short term memory, and I forget the third. - Timothy Leary

Introduction :

Introduction A transaction includes one or more database access operations which include insertion,deletion , modification ,or retrival operations.


Definition Collection of operations that form a single logical unit of work is called a transaction.

Acid properties of transaction:

Acid properties of transaction They are useful in order to avoid failures during concurrent access to a database. ACID IS acronym for Atomicity Consistency Isolation Durability


Atomicity Atomicity states that database modifications must follow an “all or nothing” rule If one part of transaction fails,the entire transaction fails The database system keeps track( ondisk ) of old values and if the transaction doesn't complete its execution it restores the old values and appears as it was never performed It is handled by a component called transaction management component


consistency If the database is consistent before an execution of the transaction,the database remains consistent after the execution of transaction Only valid data must be written to the data base otherwise it will be roll backed Ensuring consistency is the responsibility of application programmer who codes the transaction

Isolation :

Isolation Every transaction should be kept unaware of other transactions and execute independently. Intermediate results generated by the transactions must not be available to other transaction Responsible component concurrency control component A way to avoid the problem is to execute serially (practically not possible)


durability Data remains consistent state even after failure This is due to by loading modified data into disk It enables a system to recover after system crash Handled by recovery management component of dbms

Transaction state :

Transaction state Active state : initial state, stays in this state while running Abort : returns the system to the beginning state of transaction Commit : declare permanently complete Partially commited : all the statement in the transaction have been completed Failed state: the transaction has encountered an abnormal condition and cannot continue

Schedule :

Schedule It is a collection of many transactions which is implemented as a unit Depending upon how these transactions are arranged in with In a schedule a schedule is of 2 types 1.serial 2.concurrent ( cpu time shared)


serialisability A serial schedule is a schedule whose net result is execution of those serial in schedule Consistency problem in concurrent execution are resolved by serialization It is implemented by 2 operations i.e locks and releases. Locks can be shared or excusive

Types of locks Shared / Exclusive Locks:

Types of locks Shared / Exclusive Locks Shared Lock – Concurrent Transactions are granted READ access on the basis of a common lock Exclusive Lock – Access is reserved for the transaction that locked the object

Types of Locks: Binary:

Types of Locks: Binary Binary Locks – Lock with 2 States Locked – No other transaction can use that object Unlocked – Any transaction can lock and use object


Deadlocks Occur when 2 transactions exist in the following mode: T1 = access data item X and Y T2 = Access data items Y and X If T1 does not unlock Y, T2 cannot begin If T2 does not unlock X, T1 cannot continue T1 & T2 wait indefinitely for each other to unlock data Deadlocks are only possible if a transactions wants an Exclusive Lock (No Deadlocks on Shared Locks)

authorStream Live Help