[go: up one dir, main page]

0% found this document useful (0 votes)
65 views11 pages

3b. Transaction Processing1

Transactions have the ACID properties of atomicity, consistency, isolation, and durability. A transaction reads or writes database values as a single unit and must fully commit or rollback. It takes the database from one consistent state to another. Isolation ensures transactions execute independently without interfering with each other. Once committed, a transaction's changes persist even if the system fails.

Uploaded by

Tinashe Kota
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)
65 views11 pages

3b. Transaction Processing1

Transactions have the ACID properties of atomicity, consistency, isolation, and durability. A transaction reads or writes database values as a single unit and must fully commit or rollback. It takes the database from one consistent state to another. Isolation ensures transactions execute independently without interfering with each other. Once committed, a transaction's changes persist even if the system fails.

Uploaded by

Tinashe Kota
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/ 11

Transaction processing

INTODUCTION
 Transaction it’s a unit of work, possibly consisting of multiple data accesses and updates, that
must commit or abort as a single atomic unit. Transactions have the ACID properties of
Atomicity, Consistency, Isolation, and Durability.
 A transaction is a unit of a program execution that accesses and possibly modifies various data
objects (tuples, relations).
 Or Generally a transaction reads a value from the database or writes a value to the database.
ACID PROPERTIES

Atomicity
 This means either all operations of a transaction complete successfully, or none of them do
Read A;
A = A – 100;
Write A;
Read B;
B = B + 100;
Write B;
suppose there is a power failure just after instruction 3
CONSISTENCY

If we execute a particular transaction in isolation or together with other transaction, the
transaction will yield the same expected result.
Every database management system supports the execution of multiple transactions at the
same time, using CPU Time Sharing
Careful mechanisms are created in order to prevent mismanagement of these sharable
resources, so that there should not be any change in the way a transaction performs.
A transaction should take the database from one consistent state to another consistent state.
It should not adversely affect any data item in the database.
ISOLATION
 A transaction's behavior is not impacted by the presence of other transactions that may be
accessing the same database concurrently. That is, a transaction sees only a state of the
database that could occur if that transaction were the only one running against the database
and produces only results that it could produce if it was running alone
A transaction should be executed as if it is the only one in the system. There should not be
any interference from the other concurrent transactions that are simultaneously running.
DURABILITY

It states that once a transaction has been complete the changes it has made should be
permanent.
The effects of committed transactions survive failures. Once a transaction commits, its
updates are guaranteed to be reflected in the database even if the contents of volatile (e.g.,
main memory) or non-volatile (e.g., disk) storage are lost or corrupted.
Once the COMMIT is done, the changes which the transaction has made to the database are
immediately written into permanent storage.
If a committed transaction brings about a change, that change should be durable in the
database and not lost in case of any failure.
CONT.
Atomicity, consistency, and durability address correctness for serial execution of transactions, where
only a single transaction at a time is allowed to be in progress. In practice, however, database
management systems typically support concurrent execution, in which the operations of multiple
transactions can be executed in an interleaved fashion.
The motivation for concurrent execution in a DBMS is similar to that for multiprogramming in
operating systems, namely, to improve the utilization of system hardware resources and to provide
multiple users a degree of fairness in access to those resources.
The isolation property of transactions comes into play when concurrent execution is allowed
TRANSACTION OPERATIONS
The low level operations performed in a transaction are −
begin_transaction − A marker that specifies start of transaction execution.
read_item or write_item − Database operations that may be interleaved with main memory
operations as a part of transaction.
end_transaction − A marker that specifies end of transaction.
commit − A signal to specify that the transaction has been successfully completed and will not be
undone.
rollback − A signal to specify that the transaction has been unsuccessful and so all temporary
changes in the database are undone. A committed transaction cannot be rolled back.
Transactions are used to structure complex processing tasks which consist of multiple data
accesses and updates.
TRANSACTION DIAGRAM
TRANSACTION STATES

A transaction may go through a subset of five states, active, partially committed, committed, failed and
aborted.
Active − The initial state where the transaction enters is the active state. The transaction remains in
this state while it is executing read, write or other operations.
Partially Committed − The transaction enters this state after the last statement of the transaction has
been executed.
Committed − The transaction enters this state after successful completion of the transaction and
system checks have issued commit signal.
Failed − The transaction goes from partially committed state or active state to failed state when it is
discovered that normal execution can no longer proceed or system checks fail.
Aborted − This is the state after the transaction has been rolled back after failure and the database has
been restored to its state that was before the transaction began.
THE END

You might also like