ITWissen.info - Tech know how online

Java transaction API (JTA)

The Java Transaction API (JTA) specifies a programming interface (API) in Java, jointly designed by Sun and the Java Community Process, for controlling transactions, particularly in the environment of distributed systems. JTA takes into account the X/Open XA standard for the interaction of different XA resources - these can be transactional applications, databases, transaction managers or application servers.

JTA is part of the Java Enterprise Platform (Java Enterprise Edition) and therefore always part of a J2EE-compatible application server. If JTA is to be used in the Java Standard Edition environment, a corresponding transaction manager such as JOTM (Java Open Transaction Manager) must be integrated in any case. JOTM is a transaction manager available as open source that supports a number of middleware platforms such as J2EE, CORBA, web services or OSGi. The definition of JTA is part of the Java Specification Request( JSR) number 907, which is also available at the link below.

Transactions in JTA

Transactions are characterized by the fact that they only permanently change the data held in a database if the individual phases of the transaction have run completely error-free. In this context, one also speaks of the ACID paradigms of a transaction. The special feature of distributed transactions is that they operate concurrently on several resources such as databases. Distributed transactions are also referred to as Distributed Transaction Processing( DTP). Consequently, more complex transaction control is also required - the JTA is the visible interface for controlling transactions against which a developer programs. The JTA specifies Java interfaces and exception classes between a transaction manager and the components involved in the transaction. These can be transactional applications, managers of resources, messaging services, or an application server. So, in any case, the JTA always communicates with a transaction manager and is provided to the developer in the javax.transactionpackage.

Java Transaction Services (JTS)

In connection with the JTA, however, the term Java Transaction Services (JTS) is still important. This interface is however less interesting for the developer of an application and also not directly visible, since JTS is directly implemented in the transaction manager for example JOTM or in the Java EE application server. Therefore also in the Java standard edition a transaction manager must be merged, which offers then the support for the JTA interface. The transaction manager implements the Java mapping of the OMG Object Transaction Service Specification for this. For the forwarding of the Transkationen CORBA interfaces or the Internet Inter- ORB Protocol( IIOP) are used thereby.

The X/Open XA standard is the basis for the JTA. The X/Open XA specification in turn defines Distributed Transaction Processing (DTP). The central component of this specification is the transaction manager, which organizes the distributed transactions with several so-called resources. These resources in turn implement the XA protocol, which is a two- phase commit protocol. This provides for the correct execution of a distributed transaction over several resources.

In practice, however, a more convenient framework such as Hibernate, Spring or others is often used instead of direct programming against the JTA interfaces, so that the application developer is relieved of the complexity of the JTA.

Informations:
Englisch: Java transaction API - JTA
Updated at: 09.11.2013
#Words: 521
Links: Java, application programming interface (API), interface (I/F), distributed systems, account
Translations: DE
Sharing:    

All rights reserved DATACOM Buchverlag GmbH © 2024