TRANSACTION
MANAGEMENT
TRANSACTION
Transactions are a set of
operations used to perform a
logical set of work.
A transaction usually means that
the data in the database has
changed.
One of the important properties
of the transaction is that it
contains a finite number of steps.
TRANSACTION STATES
PROPERTIES OF
TRANSACTION
For a transaction to be performed in DBMS, it
must possess several properties often called
ACID properties
A – Atomicity
C – Consistency
I – Isolation
D – Durability
OBJECTIVES OF DISTRIBUTED TRANSACTION
MANAGEMENT
The responsibilities of the
transaction manager in
distributed DBMS is same as that
of corresponding centralized
database system but its task is
complicated owing to
fragmentation, replication and
the overall distributed nature of
the database.
The primary objective of the
transaction manager is to
execute the transactions in an
efficient way in order to preserve
the ACID properties of the
transactions irrespective of
concurrent execution of
transactions and system failures.
At the same time efficiency of
the transactions should be
improved to meet the
iv Communication cost should
be minimized: In a distributed
system an additional
communication cost is incurred
for each distributed or global
application, because a number of
message transfers are required
between sites. Preventive
measures should be adopted by
the transaction manager to
minimize the communication
What is a distributed
transaction?
A distributed transaction spans
multiple systems, ensuring all
operations either succeed or fail
together, crucial for maintaining
data integrity and consistency
across diverse and geographically
separated resources in modern
computing environments
Working of Distributed
Transactions
The working of Distributed Transactions is
the same as that of simple transactions
but the challenge is to implement them
upon multiple databases. Due to the use
of multiple nodes or database systems,
there arises certain problems such as
network failure, to maintain the
availability of extra hardware servers and
database servers. For a successful
distributed transaction the available
resources are coordinated by transaction
managers.
Step 1: Application to
Resource – Issues Distributed
Transaction
The first step is to issue that
distributed transaction. The
application initiates the
transaction by sending the
request to the available
resources. The request consists of
details such as operations that
are to be performed by each
Step 2: Resource 1 to Resource 2 –
Ask Resource 2 to Prepare to
Commit
Once the resource receives the
transaction request, resource 1
contacts resource 2 and asks resource
2 to prepare the commit. This step
makes sure that both the available
resources are able to perform the
dedicated tasks and successfully
complete the given transaction.
Step 3: Resource 2 to Resource 1
– Resource 2 Acknowledges
Preparation
After the second step, Resource 2
receives the request from Resource 1,
it prepares for the commit. Resource
2 makes a response to resource 1
with an acknowledgment and
confirms that it is ready to go ahead
with the allocated transaction.
Step 4: Resource 1 to Resource 2 –
Ask Resource 2 to Commit
Once Resource 1 receives an
acknowledgment from Resource 2, it
sends a request to Resource 2 and
provides an instruction to commit the
transaction. This step makes sure that
Resource 1 has completed its task in
the given transaction and now it is
ready for Resource 2 to finalize the
operation.
Step 5: Resource 2 to Resource 1 –
Resource 2 Acknowledges Commit
When Resource 2 receives the commit
request from Resource 1, it provides
Resource 1 with a response and makes an
acknowledgment that it has successfully
committed the transaction it was
assigned to. This step ensures that
Resource 2 has completed its task from
the operation and makes sure that both
the resources have synchronized their
states.
Step 6: Resource 1 to Application –
Receives Transaction
Acknowledgement
Once Resource 1 receives an
acknowledgment from Resource 2,
Resource 1 then sends an
acknowledgment of the transaction back
to the application. This acknowledgment
confirms that the transaction that was
carried out among multiple resources
has been completed successfully.