1 / 16

Java Transaction API

Java Transaction API. Prepared by Mehmet Küçüksayan Mustafa Ecmel Özdemir. 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. Transaction.

Download Presentation

Java Transaction API

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 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 transactionin 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 • Applicationserver, JDBC driver and transaction manager care about the distributed transactionmanagement. • 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. + guaranteesACID properties. + application developer does not need to care about the transaction management - does not support nested transactions.

  16. Any Questions???

More Related