Understanding JTA

Please download to get full document.

View again

of 7
7 views
PDF
All materials on our website are shared by users. If you have any questions about copyright issues, please report us to resolve them. We are always happy to assist you.
Document Description
Understanding JTA—the Java Transaction API JTA allows applications to perform distributed transactions—to access and update data on two or more networked computer resources. JTA support in a JDBC driver yields greatly increased data access power. Here's how. The purpose of this article is to provide a high-level overview of the Java Transaction API (JTA), and how it is related to distributed transactions. A transaction defines a logical unit of work that either completely succeeds or produces
Document Share
Documents Related
Document Tags
Document Transcript
  Understanding JTA—the Java Transaction API   J  TA allows applications to perform distributed transactions—to access and update data on twoor more networked computer resources. JTA support in a JDBC driver yields greatly increaseddata access power. Here's how.  The purpose of this article is to provide a high-level overview of the Java Transaction API (JTA), and how it is related to distributed transactions. Atransaction defines a logical unit of work that either completely succeeds orproduces no result at all. A distributed transaction is simply a transaction thataccesses and updates data on two or more networked resources, andtherefore must be coordinated among those resources. In this paper, we areconcerned primarily with transactions that involve relational databasesystems. The components involved in the distributed transaction processing (DTP)model that are relevant to our discussion are: ã  The application ã  The application server ã  The transaction manager ã  The resource adapter ã  The resource managerIn the following sections, we describe these components and their relationshipto JTA and database access. Accessing Databases It is best to think of the components involved in distributed transactions asindependent  processes , rather than thinking of them in terms of location on aparticular computer. Several of the components may reside on one machine,or they may be spread among several machines. The diagrams in thefollowing examples may show a component on a particular computer, but therelationship among the processes is the primary consideration. The Simplest Case: Application to Database Local Transactions  The simplest form of relational database access involves only the application,a resource manager, and a resource adapter. The application is simply theend-user access point to send requests to, and obtain data from, a database. The resource manager in our discussion is a relational database managementsystem (RDBMS), such as Oracle or SQL Server. All of the actual databasemanagement is handled by this component. The resource adapter is the component that is the communications channel,or request translator, between the outside worlds, in this case theapplication, and the resource manager. For our discussion, this is a JDBCdriver. The following description is of a resource manager local transaction , that is,  one transaction that is confined to a single, specific enterprise database. The application sends a request for data to the JDBC driver, which thentranslates the request and sends it across the network to the database. Thedatabase returns the data to the driver, which then translates the result to theapplication, as illustrated in the following diagram: This example illustrates the basic flow of information in a simplified system;however, the enterprise of today uses application servers, which adds anothercomponent to the process. Application Servers  The application server is another component of the transaction process that isaddressed by the JTA. Application servers handle the bulk of applicationoperations and take some of the load off of the end-user application. Buildingon the preceding example, we see that the application server adds anotherprocess tier to the transaction:  Up to this point, our examples illustrate a single, local transaction anddescribe four out of the five components of the distributed transaction model. The fifth component, the transaction manager, comes into consideration onlywhen transactions are to be distributed.  Distributed Transactions and the Transaction Manager As we stated previously, a distributed transaction is a transaction thataccesses and updates data on two or more networked resources. Theseresources could consist of several different RDBMSs housed on a single sever,for example, Oracle, SQL Server, and Sybase; or they could include severalinstances of a single type of database residing on a number of differentservers. In any case, a distributed transaction involves coordination amongthe various resource managers. This coordination is the function of thetransaction manager. The transaction manager is responsible for making the final decision either tocommit or rollback any distributed transaction. A commit decision should leadto a successful transaction; rollback leaves the data in the databaseunaltered. JTA specifies standard Java interfaces between the transactionmanager and the other components in a distributed transaction: theapplication, the application server, and the resource managers. Thisrelationship is illustrated in the following diagram:
We Need Your Support
Thank you for visiting our website and your interest in our free products and services. We are nonprofit website to share and download documents. To the running of this website, we need your help to support us.

Thanks to everyone for your continued support.

No, Thanks