Dbms
Dbms
Narr
Customor has
Actcress
WGak Entity Type
Lcocuhon
Now that we understand what transaction. we should understand what are the protblens
associatcd with it.
ACID
Muitiple Transaçtions occur independently
+=Isolation without interference.
Atomicity
By this, we mean that either the entire transaction takes place at once or doesn't happen at all.
There is no midway i.e. transactions do not occur partially/ Each transaction is considered as
one unit and either runs to completion or is not executed at all, It involves the following two
operations.
-Abort: If a transaction aborts, changes made to database are not visible.
Commit: If transaction commits, changes
Atomicity is also known as the 'All or nothing rule.
made are
evisible.
Consider the following transaction Tconsisting of Tl and T2: Transfer of 100 from
account X to account Y.
Before: %:500 Y: 200
Transaction T
Consistency
This means that integrity constraints must be maintained so that the database is consistent
beforc and after the transaction. It refers to the correctness of a database. Referring to the
example above, The total amount before and after the transaction must be maintained.
Total before T occurs =500 + 200 = 700.
Total after T occurs = 400 + 300 = 700.
Jsolation
Thisproperty ensures that multiple transactions can occur concurrently without leading to the
inconsistency of database state. Transactions occur independently without interference.
Changes occurring in a particular transaction will not be visible to any other transaction until
that particular change in that transaction is written to memory or has been commited. This
property ensures that the execution of transactions concurrently will result in a state that is
equivalcnt to a state achieved these were executed serially in Some order.
Let X= 500. Y = 500.
Suppose T has been executed tillRead (Y) and then T'' starts. As a result , interleaving of
operations takes place due to which T'' reads correct value of X but incorrect value of Y and
sum computed by
T': (X+Y = 50, 000+500=50, 500)
thås not consistent with the Sum at end of transaction:
T: (X+Y =50, 000 + 450 = 50, 450).
This results in database inconsistency, due to a loss of 50units,. Hence, transactions must take
place
memory
in isolation and changes should be visible only after they have been made to the main
Hurability:
This property ensures that once the transaction has completed execution, the updates and
modifications to the database are stored in and written to disk and they persist even if asystem