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 global identifier is based on the transaction identifier in the CosTransactions::PropagationContext: object and the local identifier identifies the transaction uniquely in the local Java virtual machine (JVM).
Advanced applications can use this callback to flush updates before transaction completion and clear up state after transaction completion. J2EE (and related) specifications position this function generally as the domain of the J2EE containers.
ExtendedJTATransaction exJTA = (ExtendedJTATransaction)ctx.lookup(" java:comp/websphere/ExtendedJTATransaction"); SynchronizationCallback sync = new SynchronizationCallback(); exJTA.registerSynchronizationCallback(sync);
The following information is an overview of the interfaces that the Extended JTA support provides. For more detailed information, see the generated API documentation.
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. So, 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 it to acquire a Java Database Connectivity (JDBC) connection and flush updates to a database during the beforeCompletion method.
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.