Download presentation
Presentation is loading. Please wait.
Published byAdrian Hines Modified over 7 years ago
1
Prepared by Mehmet Küçüksayan Mustafa Ecmel Özdemir
Java Transaction API Prepared by Mehmet Küçüksayan Mustafa Ecmel Özdemir
2
Outline Transaction Java Transaction Java API Java Transaction API
Transaction and Resource Managers JTA vs JDBC JTA vs EJB Extensions to JTA Advantages and Disadvantages of JTA
3
Transaction is a complete unit of work that completes succesfully or results with unaltered state. has two types; Local transactions Distributed transactions
4
Java Transaction Java Transaction Service(JTS)
- specifies the implementation of a Java transaction manager. Java Transaction API(JTA) - calls the lower-level JTS methods.
5
Java Transaction Initiative
6
Java API consists of Java classes Packages Interfaces
Each version of Java has its own API
7
Java Transaction API high level, implementation independent, protocol independent API. offered by J2EE technology. provides reliable environment for the J2EE container.
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
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.
10
Transaction Environment Schema
Interfaces: 1. UserTransaction 2. Transaction Manager 3. XA Resource
11
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.
12
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.
13
JTA vs EJB EJB container is responsible for transaction processing.
A stateless session bean can obtain a UserTransaction object via the EJBContext using the getUserTransaction() method. Session bean usage could be bundled together with a JTA UserTransaction object where each session bean is deployed on a different EJB server.
14
Extensions to JTA 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.
15
Advantages vs Disadvantages
+ provides modularity. + guarantees ACID properties. + application developer does not need to care about the transaction management - does not support nested transactions.
16
Any Questions???
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.