Extended JTA support

Extended Java Transaction API (JTA) support provides application programming interfaces (APIs) additional to the UserTransaction interface that is defined in the JTA as part of the J2EE specification.

The API extensions provide the following functionality:
An application uses a Java Naming and Directory Interface (JNDI) lookup of java:comp/websphere/ExtendedJTATransaction to get an ExtendedJTATransaction object, which the application uses as shown in the following example:
ExtendedJTATransaction exJTA = (ExtendedJTATransaction)ctx.lookup("
	java:comp/websphere/ExtendedJTATransaction");
SynchronizationCallback sync = new SynchronizationCallback();
exJTA.registerSynchronizationCallback(sync);
The ExtendedJTATransaction object supports the registration of one or more application-provided SynchronizationCallback objects. Depending on how the callback is registered, each registered callback is called at one of the following points:

The following information is an overview of the interfaces that the Extended JTA support provides. For more detailed information, see the generated API documentation.

SynchronizationCallback interface

An object implementing this interface is enlisted once through the ExtendedJTATransaction interface, and receives notification of transaction completion.

Although an object implementing this interface can run on a J2EE server, there is no specific J2EE component active when this object is called. Therefore, the object has limited direct access to any J2EE resources. Specifically, the object has no access to the java: namespace or to any container-mediated resource. Such an object can cache a reference to a J2EE component (for example, a stateless session bean) that it delegates to. The object would then have all the normal access to J2EE resources. For example, you could use the object to acquire a Java Database Connectivity (JDBC) connection and flush updates to a database during the beforeCompletion method.

ExtendedJTATransaction interface

This interface is a WebSphere programming model extension to the J2EE JTA support. An object implementing this interface is bound, by J2EE containers in WebSphere Application Server that support this interface, at java:comp/websphere/ExtendedJTATransaction. Access to this object, when called from an Enterprise JavaBeans (EJB) container, is not restricted to component-managed transactions.

To register a synchronization instance, rather than using the registerSynchronizationCallbackForCurrentTran method, use the registerInterposedSynchronization method of the TransactionSynchronizationRegistry interface.




Related concepts
Global transactions
Transaction support in WebSphere Application Server
Related tasks
Using the transaction service
Related information
Additional Application Programming Interfaces
Concept topic    

Terms of Use | Feedback

Last updated: Feb 19, 2011 5:25:36 AM CST
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=v610web&product=was-nd-mp&topic=cjta_extjta
File name: cjta_extjta.html