Transaction Management & Concurrency Control
Transaction Management & Concurrency Control
Atomicity
Requires that all operations (SQL requests) of a transaction
be completed; if not, then the transaction is aborted
A transaction is treated as a single, indivisible, logical unit of
work
This “all-or-none” property is referred to as atomicity.
Consistency
Consistency property ensures that the database must
the database.
If for some reason a transaction is executed that violates
SOLUTION
Clearly, there exists a cycle in the precedence graph.
Method-01:
In both schedules S and S1, there is no read except the initial read that's
why we don't need to check that condition.
T1 → T2→ T3
Irrecoverable Schedules-
If in a schedule,
A transaction performs a dirty read operation from an
uncommitted transaction
And commits before the transaction from which it has read the
If in a schedule,
Two types:
Cascadeless schedule
Cascading schedule
CASCADING SCHEDULE
Even if a schedule is recoverable ,to recover
correctly from failure of transaction Ti, we may have
to roll back several transaction.
Such situations occur if transactions have read data
written by Ti.
In the above example ,transaction T8 has been
aborted.
Shared mode
If a transaction Ti has obtained a shared –mode
lock(denoted by S) on item Q, then Ti can read, but
cannot write Q.
Any other transaction can obtain the same lock, on
same data item at same time.
Denoted by Lock-S(Q)
Locks
Exclusive mode
If a transaction Ti has obtained an exclusive-mode
lock(denoted by X) on item Q, then Ti can both read
and write Q.
Any other transaction cannot obtain either
exclusive/shared lock.
The wait for the graph is maintained by the system for every
transaction which is waiting for some data held by the others.