JTA and JTs have their respective roles and responsibilities for distributed transactions.

Source: Internet
Author: User

There are many terms in the J2EE application system, including JTA and JTs. The first contact can feel a specific relationship between the two, but it cannot be defined as the name suggests. I usually use C ++ for development and seldom read these things. I don't know either of them. It's just a technology. However, due to the recent study, we need to figure out the relationship between the two. So I found some information on the Internet and thought about it a little bit. I feel sun is so fond of learning it, so many terms cannot be the name suggests. JTA and JTs are a set of conventions or specifications used for Distributed Transaction Management.

Generally, JTA is an interface specification that defines a set of interfaces and related interfaces.ProgramThe conventions that need to be observed between roles. In JTA, there are several main program roles: Transaction Manager, transaction customer, application server, and resource manager. Simply put, the transaction client initiates a transaction. The application server determines how to submit a transaction request to the Transaction Manager body based on the request of the transaction client, such as a new require (require new) the transaction manager receives the transaction request from the application server, and then the Transaction Manager submits the request according to a specific protocol (generally the two-phase commit protocol) and the resource manager implement the transaction function by exchanging the transaction context. Here, the transaction client uses the usertransaction interface, the application server uses the transactionmanager, transaction, and synchronization interfaces, and the resource manager implements the xaresource interface.

What about JTs? What is the relationship between JTA and JTs? As mentioned above, the transaction manager and the resource manager need to communicate with each other in transaction context propagation. The application server and the Transaction Manager also have interaction between the propagation transaction context, sometimes the transaction client and the application server also need to spread the transaction context. As we all know, as long as software interaction is involved, there will always be a set of specifications. How can we transmit this transaction context? This is JTs. JTs also defines a set of specifications that specify how transaction context is transmitted between program roles. It is derived from the OTs specification of CORBA and is based on IIOP (a software interaction protocol ). Don't think that JTs is the implementation of JTA. JTA actually defines an empty shelf to tell JTA's implementers how to do it, but JTs will plug in when it comes to implementation. Because the roles agreed by JTA need to interact with the transaction context, JTs agreed on how to interact.

In general, JTA is more about defining the interface of a program role from the Framework perspective, while JTs defines the interface between program roles from the perspective of specific implementation, both of them perform their respective duties. In this way, sun's two names are somewhat artistic and philosophical.

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.