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

Unit 6 - Managing Transactions

This document provides an overview of managing transactions in JBoss Server systems. It discusses configuring JTA transactions at the domain level and monitoring transactions using the console. Key points include: - Transactions ensure data integrity by allowing either all or none of a group of operations to occur. - Distributed transactions coordinate multiple resource managers using a two-phase commit protocol to ensure consistency across resources. - JBoss uses the Java Transaction API and two-phase commit to manage distributed transactions, creating transaction IDs and coordinating commit/rollback across databases. - The transaction log stores information about committed transactions in case of failures during coordination.

Uploaded by

avinjoy
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
53 views

Unit 6 - Managing Transactions

This document provides an overview of managing transactions in JBoss Server systems. It discusses configuring JTA transactions at the domain level and monitoring transactions using the console. Key points include: - Transactions ensure data integrity by allowing either all or none of a group of operations to occur. - Distributed transactions coordinate multiple resource managers using a two-phase commit protocol to ensure consistency across resources. - JBoss uses the Java Transaction API and two-phase commit to manage distributed transactions, creating transaction IDs and coordinating commit/rollback across databases. - The transaction log stores information about committed transactions in case of failures during coordination.

Uploaded by

avinjoy
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 17

JBoss Server System Administration

Unit 6 – Managing Transactions


Managing Transactions

At the end of this module you will be able


• Configure JTA transactions on the domain level
• Monitor transactions using the console
Road Map

1. Configuring and Monitoring Transactions


– The configurable Transaction attributes
– The Transaction Log
What Is a Transaction?

• A transaction is a mechanism to handle groups


of operations as though they were one.
• Either all operations in a transaction occur or
none at all.
• Operations involved in a transaction may rely
on many different servers and databases.
ACID Properties of a Transaction

• A transaction is formally defined by the set of


properties known by the acronym ACID.
• Atomicity: a transaction is done or undone
completely. In the event of a failure, all operations
and procedures are undone, and all data rolls back
to its previous state.
• Consistency: a transaction transforms a system from
one consistent state to another consistent state.
• Isolation: each transaction occurs independently of
other transactions occurring at the same time.
• Durability: completed transactions remain
permanent, even during system failure.
Transferring without Transactions

• Successful transfer:

• Unsuccessful transfer (accounts are left in an


inconsistent state):
Successful Transfer with Transactions

• Changes within a transaction are buffered.

• If a transfer is successful, changes are


committed (made permanent).
Unsuccessful Transfer with Transactions

• Changes within a transaction are buffered.

• If a problem occurs, the transaction is rolled


back to the previous consistent state.
What Are Distributed Transactions?

• A resource, like a database, is controlled through


software called a resource manager (RM).
• A local transaction is a transaction that deals
with a single resource manager.
• A distributed transaction is a transaction that
coordinates or spans multiple resource managers.
• Coordination of multiple resource managers is
done by a transaction manager (TM).
• A transaction is often referred to as a transaction
context.
The Two-Phase Commit Protocol

• The 2PC protocol uses two steps to commit


changes within a distributed transaction.
• Phase 1 asks all RMs to prepare to make the
changes and if any of them cannot, the
transaction is aborted.
• Phase 2 asks all RMs to actually commit and make
the changes permanent.
• A global transaction ID (XID) is used to track all
changes associated with a distributed transaction.
Extended Architecture Protocol

• The Extended Architecture (XA):


– Is the interface used between JBoss and
Resource Managers
– Implements the 2PC protocol
– Allows programs to control RMs that are
involved in distributed transactions
Transaction and Resource Managers

• A Transaction manager coordinates several


resource managers.
• The two-phase commit (2PC) protocol is used to
coordinate the transaction.
• The XA protocol implements 2pc
Successful Two-Phase Commit
Unsuccessful Two-Phase Commit
Java Transaction API (JTA)…

• JBoss uses JTA 1.0.1 to implement and manage transactions.


• JBoss JTA provides the following support:
– Creates unique transaction identifier (XID)
– Supports optional transaction name
– Tracks objects involved in transaction
– Notifies databases of transaction
– Orchestrates 2PC using XA
– Executes rollbacks
– Executes automatic recovery procedures when failure
– Manages time-outs
Transaction Log

• A Transaction Log stores information about


commited transactions coordinated by the
server that may not have been completed.
• A transaction log consists of multiple files; each
is subject to garbage collection by the
transaction manager.
• When none of the records in a transaction log
file are needed, the system deletes the file and
returns the disk space to the file system.
• If the previous log file becomes too large or a
checkpoint occurs, the system creates a new
transaction log file.
Module Review

• In this module we discussed:


– Monitor transactions in JBoss Servers

You might also like