Java Transaction API

from Wikipedia, the free encyclopedia
Java Transaction API
Basic data

Maintainer Java Community Process
developer Sun Microsystems
Current  version 1.1.
(November 1, 2002)
operating system platform independent
programming language Java (programming language)
category Programming interface
License Common Development and Distribution License
oracle.com/technetwork/java/javaee/jta

The Java Transaction API ( JTA ) is a programming interface (API) specified by Sun and the Java Community Process , which enables the use of distributed transactions over several XA resources under Java .

tasks

Transaction management is an important part of business-critical IT applications. It is u. a. Responsible for ensuring that transactions only permanently change the data of an application stored in a database if they can be completed without any errors.

However, transactions are not only necessary for individual databases, but also for other resources (such as messaging systems). Distributed transactions are also often necessary, i.e. transactions that run against several resources (e.g. several databases) at the same time. This is exactly what the implementation of JTA does. Other criteria such as thread safety (concurrency), such as avoiding race conditions , do not fall within the JTA's area of ​​responsibility.

Functionality and use

JTA itself defines the interface (interfaces and exception classes) via which Java programs can communicate with transaction managers. For their part, transaction managers usually implement the Java Transaction Service programming interface (JTS), which is the standard interface for JTA-enabled transaction servers. JTS itself is a specification for transaction managers, which implements the JTA specification on the communication level and the OMG Object Transaction Services specification (OTS) for Java mapping.

The JTA is based on the X / Open-XA standard, which is a specification published by the Open Group for Distributed Transaction Processing, the processing of transactions distributed over several systems. This standard provides for the use of a transaction manager to coordinate transactions across multiple resources. The resources themselves typically offer their own interfaces for handling transactions (for example transactions via the JDBC - SQL interface for databases). In addition, they have to implement the XA protocol for X / Open XA, only then is a resource called "XA-compliant". Using the two-phase commit protocol , the X / Open-XA standard ensures that a transaction that is distributed across different resources runs correctly.

The Java Transaction API is one of the programming interfaces of the Java Platform, Enterprise Edition and therefore an essential part of all Java application servers . When using the Java Platform, Standard Edition , however, a JTA-capable transaction manager must be used. Examples are TransactionsEssentials from Atomikos or the Java Open Transaction Manager (JOTM) - see web links.

Usually, programming is not carried out directly against the JTA during development, but rather using frameworks such as Spring , Hibernate or TopLink . Using JTA, these frameworks can guarantee controlled transaction management across distributed resources without the developer coming into contact with the complexity of the JTA.

history

The Java Transaction API was developed by Sun and the Java Community Process under the Java Specification Request (JSR) 907. The first version of the JTA was adopted together with the JTS specification in December 1999. The slightly improved version 1.0.1 was completed on September 27, 2001. The current version is JTA 1.1 from November 1, 2002.

See also

Web links

Individual evidence

  1. Susan Cheung, Vlada Matena: Java Transaction API 1.1 Specification (PDF) September 1, 2002
  2. Susan Cheung: Java Transaction Service (JTS) specification (PDF; 62 kB) December 1, 1999