0% found this document useful (0 votes)
3 views

Transaction Unit5

lk

Uploaded by

fthmsherinkp
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Transaction Unit5

lk

Uploaded by

fthmsherinkp
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Transaction management

A transaction can include the following basic database access operation.


 Read/Access data (R): Accessing the database item from disk (where the database
stored data) to memory variable.
 Write/Change data (W): Write the data item from the memory variable to the disk.
 Commit: Commit is a transaction control language that is used to permanently save
the changes done in a transaction

Transaction States

Serializability
Serializability is a way to check whether two transactions working on a database are
maintaining database consistency or not.
Schedule
Schedule, as the name suggests is a process of lining the transactions and executing them
one by one.
Concurrency Control
Concurrency Control deals with interleaved execution of more than one transaction.

ACID properties in DBMS


To ensure the integrity of data during a transaction (A transaction is a unit of
program that updates various data items), the database system maintains the following
properties. These properties are widely known as ACID properties:

Atomicity: Atomicity means that an entire transaction either takes place all at once or it
doesn’t occur at all. It means that there’s no midway. The transactions can never occur
partially. Every transaction can be considered as a single unit, and they either run to
completion or do not get executed at all.Let’s take an example of banking system to
understand this: Suppose Account A has a balance of 400 & B has 700. Account A is
transferring 100 to Account B. This is a transaction that has two operations a) Debiting 100
from A’s balance b) Creating 100 to B’s balance. Let’s say first operation passed
successfully while second failed, in this case A’s balance would be 300 while B would be
having 700 instead of 800. This is unacceptable in a banking system. Either the transaction
should fail without executing any of the operation or it should process both the operations.
The Atomicity property ensures that.
Consistency: Consistency means that we have to maintain the integrity constraints so that
any given database must be consistent before and after the transaction . For example
account A is having a balance of 400 and it is transferring 100 to account B & C both. So
we have two transactions here. Let’s say these transactions run concurrently and both the
transactions read 400 balance, in that case the final balance of A would be 300 instead of
200. This is wrong. If the transaction were to run in isolation then the second transaction
would have read the correct balance 300 (before debiting 100) once the first transaction
went successful.
Isolation: For every pair of transactions, one transaction should start execution only when
the other finished execution.Multiple transaction ocuur independently without
interference.
Durability: The durability property states that once the execution of a transaction is
completed, the modifications and updates on the database gets written on and stored in the
disk.

You might also like