The Java Transaction API (JTA) is one of the Java EE APIs allowing distributed transactions to be done across multiple XA resources. JTA is a specification developed under the Java Community Process as JSR 907. JTA provides for:
- demarcation of transaction boundaries
- X/Open XA API allowing resources to participate in transactions.
X/Open XA architecture
In the X/Open XA architecture, a transaction manager or transaction processing monitor (TP monitor), coordinates the transactions across multiple resources such as a database. Each resource has its own manager. The resource manager typically has its own API for manipulating the resource, for example the JDBC API used by relational databases. In addition, the resource manager allows a TP monitor to coordinate a distributed transaction between its own and other resource managers. Finally, there is the application which communicates with the TP monitor to begin, commit or rollback the transactions. The application also communicates with the individual resources using their own API to modify the resource.
JTA implementation of the X/Open XA architecture
The JTA API consists of classes in two Java packages:
The JTA is modelled on the X/Open XA architecture, but it defines two different APIs for demarcating transaction boundaries. It distinguishes between an application server such as an EJB server and an application component. It provides an interface, , that is used by the application server itself to begin, commit and rollback the transactions. It provides a different interface, the , that is used by general client code such as a servlet or an EJB to manage the transactions. Below is a diagram showing the JTA classes used for the X/Open XA interfaces:
The JTA architecture requires that each resource manager must implement the interface in order to be managed by the TP monitor. As stated previously, each resource will have its own specific API, for instance:
- relational databases use JDBC
- messaging services use JMS
- generalized EIS (Enterprise Information System) resources use Java EE connector API.
Java Transaction API
The Java Transaction API consists of three elements: a high-level application
transaction demarcation interface, a high-level transaction manager interface intended
for an application server, and a standard Java mapping of the X/Open XA protocol
intended for a transactional resource manager.
UserTransaction Interface
The javax.transaction.UserTransaction interface provides the application the
ability to control transaction boundaries programmatically. This interface may be used
by Java client programs or EJB beans.
The UserTransaction.begin method starts a global transaction and associates the
transaction with the calling thread. The transaction-to-thread association is managed
transparently by the Transaction Manager.
Support for nested transactions is not required. The UserTransaction.begin method
throws the NotSupportedException when the calling thread is already associated
with a transaction and the transaction manager implementation does not support nested
transactions.
Transaction context propagation between application programs is provided by the
underlying transaction manager implementations on the client and server machines.
The transaction context format used for propagation is protocol dependent and must be
negotiated between the client and server hosts. For example, if the transaction manager
is an implementation of the JTS specification, it will use the transaction context
propagation format as specified in the CORBA OTS 1.1 specification. Transaction
propagation is transparent to application programs.
UserTransaction Support in EJB Server
UserTransaction Support in EJB Server
EJB servers are required to support the UserTransaction interface for use by EJB
beans with the TX_BEAN_MANAGED transaction attribute. The UserTransaction
interface is exposed to EJB components through the EJBContext interface using the
getUserTransaction method. Thus, an EJB application does not interface with the
Transaction Manager directly for transaction demarcation; instead, the EJB bean relies
on the EJB Server to provide support for all of its transaction work as defined in the
Enterprise JavaBeans Specification [5]. (The underlying interaction between the EJB
Server and the TM is transparent to the application.)
The code sample below illustrates the usage of UserTransaction by a
TX_BEAN_MANAGED EJB session bean:
// In the session bean’s setSessionContext method,
// store the bean context in an instance variable
this.ctx = sessionContext;
// somewhere else in the bean’s business logic
UserTransaction utx = ctx.getUserTransaction();
// start a transaction
utx.begin();
// Do work
// Commit it
utx.commit();
See also
External links
- [1] (jta-spec1 0 1)
- JSR 907
- Atomikos open source JTA implementation
- TSA Luggage Locks - 2 pack (Radio Shack) - $3.97 - SlickDeals.net TSA Luggage Locks - 2 pack (Radio Shack) - $3.97 Hot Deals.
- Luggage Tags, Luggage ID Tags, Luggage Locks & Luggage Straps Adventure travel store with a full line of travel accessories,luggage, clothing,maps,guidebooks,Eagle Creek,travel information,Lonely Planet,baggage.
- Safe Skies Heavy Duty Luggage Lock by TravelPro at HSN.com Shop at home for Safe Skies Heavy Duty Luggage Lock by TravelPro or more Luggage from the Home Shopping Network.
- TSA Luggage Locks TSA Lock TSA Luggage Belts Travel Sentry TSA Luggage Locks TSA Lock TSA Luggage Belts Travel Sentry Certified Travel Sentry luggage padlocks TSA locks, searchalert, travel sentry, travelsentry,
- Lok-it.com TSA Search Alert Luggage Lock luggage lock, TSA, search alert, combination padlocks, solid brass padlocks, key safe, keysafe, real estate key lock box, key storage, key storage box,
- The Practical Nomad blog: "Key escrow" with TSA for airline Currently, the TSA claims it isn't liable to passengers for damage to locks or luggage when it breaks into bags. That's generally true, but that doesn't
- MySpaceTV Videos: Picking four different TSA luggage locks by Graham Picking four different TSA luggage locks by Graham Watch it on MySpace Videos.
- Pacsafe StrapSafe - Secure TSA Luggage Strap - Packyourbags Travel Pacsafe StrapSafe - Secure TSA Luggage Strap - Locks which allow USA airport Luggage locks are often damaged during the search process as custom
- MySpaceTV Videos: Search Results for Tag "locks" 01: Master Luggage Lock 02: Master TSA 005 Luggage Lock 03: Brinks TSA 004 Not like normal luggage locks are that hard to pick anyway but these are
- Safe Skies TSA Locks Now Available in Radio Shack and Golfsmith File Format: PDF/Adobe Acrobat - View as HTMLTSA Approved Luggage Locks are now available at all Radio Shack Lock. These luggage locks, TSA Locks, will not be clipped by airport security.
- Travel Babel: Luggage Lock Uses Words, Not Numbers I should remember my PIN codes and combinations for luggage locks, bike locks and miscellaneous padlocks, to say nothing of numerous phone numbers,
- TSA24 4 Dial Combination Luggage Lock - 13801070017 4 Dial Combination Luggage Lock that is accepted by the Travel Security Administration (TSA) for use on checked baggage. Can be opened with your pre-set
- What Should I Consider When Buying a Luggage Lock? Brief and Straightforward Guide: What Should I Consider When Buying a Luggage Lock?
- Luggage locks - Wikipedia, the free encyclopedia Luggage locks are locks used to secure luggage. They may be built into luggage, or external locks such as padlocks or lockable straps.
- Armchair World: Luggage Locks The locks on your luggage are not that secure when it comes to the professional thief or manipulator and are really no more than a deterrent.
- Luggage Locks and Travel Security We have a brief article that explores some concerns surrounding travel security and luggage locks. Visit Designer Handbags 101 for more information.
Tags: Uncategorized by admin
No Comments »