JTA, JTS, shared duties, distributed services

Source: Internet
Author: User

Java EE application System has many nouns, including jta and JTS, just a touch can feel a certain relationship between the two, but can not be defined as the name. Because the usual work is the development of C + +, rarely look at these things, do not know it is not know, anyway is a technology just. But recently because of learning, need to understand the relationship between the two, so find some information on the Internet, but also a little to think, I feel that sun too like the mysterious, so many nouns can not be as the name suggests. JTA and JTS are a set of conventions or specifications for distributed transaction management.

In general, JTA is an interface specification that defines a set of interfaces that define the conventions that need to be adhered to by the relevant program roles, and in JTA there are several key program roles, namely, the transaction manager, the transactional client, the application server, and the resource manager. Simply put, the transaction client initiates the transaction, and the application server decides how to submit a transaction request to the transaction manager body based on the request of the client, such as a new (require new), participation (require), etc., and the transaction manager receives the transaction request issued by the application server. The transaction manager then implements the transaction's functionality based on a specific protocol (typically a two-phase commit protocol) and a resource manager that swaps the transaction context. Here, the transaction client uses the UserTransaction interface, the application server uses the TransactionManager, Transaction, synchronization interface, and the resource manager implements the Xaresource interface.

So, what about JTS? What about the relationship between JTA and JTS. The above contains references to the transaction manager's interaction with the resource manager for transactional context propagation, there is also an interaction between the application server and the transaction manager that propagates transaction contexts, and sometimes transactional and application servers also need to propagate transaction contexts, and as we all know, there is always a set of specifications involved in software interaction. So how do you pass this transaction context? This is the JTS. JTS also defines a set of specifications that define how the transaction context is passed between individual program roles, originating from CORBA's OTS specification, based on IIOP (a software interaction protocol). Do not think that JTS is the implementation of JTA, JTA actually defines an empty shelf, tell jta how to do the implementation, but specifically to do when JTS to plug in the hand. Because these roles that the JTA agreed to interact with the transaction context, JTS agreed on how to interact.

Generally speaking JTA more is to contract the interface of the program role from the frame's point of view, while JTS is to contract the interface between the program roles from the point of view of the concrete implementation. In this way, Sun's two names are really a little artistic, a little philosophical taste.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.