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.