Transaction Management in advance DBMS with properties of transaction & transition state diagram.
TRANSACTION MANAGEMENT
Transaction
A transaction is a unit of a program execution that accesses and possibly modifies various data objects (tupples, relations).
A transaction is a Logical unit of database processing that includes one or more access operations (read -retrieval, write - insert or update, delete).
A transaction (set of operations) may be stand-alone specified in a high level language like SQL
submitted interactively, or may be embedded within a program.
A transaction (collection of actions) makes transformations of system states while preserving the database consistency.
A user’s program may carry out many operations on the data retrieved from the database, but the
DBMS is only concerned about what data is read/written from/to the database.
A transaction is the DBMS’s abstract view of a user program: a sequence of reads and writes.
PROPOERTIES OF TRANSACTION
The DBMS need to ensure the following properties of transactions:
1. Atomicity
– Transactions are either done or not done
– They are never left partially executed
An executing transaction completes in its entirety or it is aborted altogether.
–e.g., Transfer_Money (Amount, X, Y) means i) DEBIT (Amount, X);
ii) CREDIT (Amount, Y). Either both take place or none
2. Consistency
– Transactions should leave the database in a consistent state
If each Transaction is consistent, and the DB starts consistent, then the Database ends up consistent.
–If a transaction violates the database’s consistency rules, the entire transaction will be rolled back and the database will be restored to a state consistent with those rules.
3. Isolation
– Transactions must behave as if they were executed in isolation.
An executing transaction cannot reveal its (incomplete) results before it commits.
–Consequently, the net effect is identical to executing all transactions, the one after the other in some serial order.
4. Durability
– Effects of completed transactions are resilient against failures
Once a transaction commits, the system must guarantee that the results of its operations will never be lost, in spite of subsequent failures.
TRANSACTION STATES
1. Active state
2. Partially committed state
3. Committed state
4. Failed state
5. Terminated State
State transition diagram illustrating the states for transaction execution:
Transaction Processing System:
No comments:
Post a Comment