JAVA TRANSACTION API
Transaction
■ is a complete unit of work that completes succesfully or
results with unaltered state.
■ has two types;
□ Local transactions
□ Distributed transactions
■ consists of
• Java classes
• Packages
• Interfaces
■ Each version of Java has its own API
Transaction Environment Schema
JTA
----------------------X Java Application
—
Application Server
— JDBC Driver
Manager I
JDBC Driver
Interfaces:
■ 1. UserTransaction
■ 2. Transaction
Manager
3. XA Resource
Database Database
Java Transaction API
■ high level, implementation independent, protocol
independent API.
■ offered by J2EE technology.
■ provides reliable environment for the J2EE
container.
Any Questions???
Extensions to the JTA can be provided. For
example;
Clients can suspend and resume the
transaction
■ Users can get and set transaction properties.
■ Users can obtain the current transaction
manager.
Java Transaction API
■ enables applications to perform distributed
transactions.
■ specifies standard Java interfaces between a
transaction manager and other components
involved in a distributed transaction system.
■ transaction manager, application, application
server, and resource manager take roles in.
JTA vs JDBC
Application server, JDBC driver and transaction
manager care about the distributed transaction
management.
Application developer should not enter the scope of
the transaction.
Outline
Transaction
■ Java Transaction
■ Java API
Java Transaction API
■ Transaction and Resource Managers
> JTAvs JDBC
JTA vs EJB
■ Extensions to JTA
■ Advantages and Disadvantages of JTA
Java Transaction
■ Java Transaction Service(JTS)
- specifies the implementation of a Java
transaction manager.
■ Java Transaction API(JTA)
- calls the lower-level JTS methods.
Java Transaction Initiative
Java Transaction Service
Advantages vs Disadvantages
+ provides modularity.
+ guarantees ACID properties.
+ application developer does not need to care about
the transaction management
- does not support nested transactions.
■ EJB container is responsible for transaction
processing.
■ A stateless session bean can obtain a
UserTransaction object via the EJBContext using the
getllserTransaction() method.
■ Session bean usage could be bundled together with a
JTA UserTransaction object where each session bean
is deployed on a different EJB server.
JTA vs JDBC
■ JDBC driver has to support both normal JDBC
interactions and XAResource part of JTA.
XA protocol enables resource manager to take
place in the transaction.
■ JDBC is responsible for "translating" between
resource manager and transaction manager.
Transaction and Resource Managers
■ Transaction manager decides whether to commit or
rollback at the end of the transaction in a distributed
system and coordinates various resource managers.
■ Resource manager is responsible from the controlling
of accessing the common resources in the distributed
system.

Introduction of Java transaction API PowerPoint

  • 1.
  • 2.
    Transaction ■ is acomplete unit of work that completes succesfully or results with unaltered state. ■ has two types; □ Local transactions □ Distributed transactions
  • 3.
    ■ consists of •Java classes • Packages • Interfaces ■ Each version of Java has its own API
  • 4.
    Transaction Environment Schema JTA ----------------------XJava Application — Application Server — JDBC Driver Manager I JDBC Driver Interfaces: ■ 1. UserTransaction ■ 2. Transaction Manager 3. XA Resource Database Database
  • 5.
    Java Transaction API ■high level, implementation independent, protocol independent API. ■ offered by J2EE technology. ■ provides reliable environment for the J2EE container.
  • 6.
  • 7.
    Extensions to theJTA can be provided. For example; Clients can suspend and resume the transaction ■ Users can get and set transaction properties. ■ Users can obtain the current transaction manager.
  • 8.
    Java Transaction API ■enables applications to perform distributed transactions. ■ specifies standard Java interfaces between a transaction manager and other components involved in a distributed transaction system. ■ transaction manager, application, application server, and resource manager take roles in.
  • 9.
    JTA vs JDBC Applicationserver, JDBC driver and transaction manager care about the distributed transaction management. Application developer should not enter the scope of the transaction.
  • 10.
    Outline Transaction ■ Java Transaction ■Java API Java Transaction API ■ Transaction and Resource Managers > JTAvs JDBC JTA vs EJB ■ Extensions to JTA ■ Advantages and Disadvantages of JTA
  • 11.
    Java Transaction ■ JavaTransaction Service(JTS) - specifies the implementation of a Java transaction manager. ■ Java Transaction API(JTA) - calls the lower-level JTS methods.
  • 12.
  • 13.
    Advantages vs Disadvantages +provides modularity. + guarantees ACID properties. + application developer does not need to care about the transaction management - does not support nested transactions.
  • 14.
    ■ EJB containeris responsible for transaction processing. ■ A stateless session bean can obtain a UserTransaction object via the EJBContext using the getllserTransaction() method. ■ Session bean usage could be bundled together with a JTA UserTransaction object where each session bean is deployed on a different EJB server.
  • 15.
    JTA vs JDBC ■JDBC driver has to support both normal JDBC interactions and XAResource part of JTA. XA protocol enables resource manager to take place in the transaction. ■ JDBC is responsible for "translating" between resource manager and transaction manager.
  • 16.
    Transaction and ResourceManagers ■ Transaction manager decides whether to commit or rollback at the end of the transaction in a distributed system and coordinates various resource managers. ■ Resource manager is responsible from the controlling of accessing the common resources in the distributed system.