Index Changes
This is version 2. It is not the current version, and thus it cannot be edited.
[Back to current version]   [Restore this version]

Under Construction

Transaction propagation example (WS-AtomicTransaction)

This example shows how to use transaction with HTTP/SAOP BC and demonstrates transaction propagation with the BP SE.

  • Developers use existing Java Transaction APIs (JTA). Invocations of transacted web service operations flow transactional context from client to web service. Persistent resources updated with client-created transactions are all committed or rolled back as a single atomic transaction.
  • After the client-side code commits or aborts the JTA transaction, the client confirms that all operations in the transaction succeeded or failed by using calls to verify methods on the transacted web service.

SampleServiceClient, a WSIT servlet that initiates the transaction interact with the following components running on the service-side:

  • SoapWSATCompositeApp, a web service implemented as a JBI compposite Application using the HTTP/SOAP BC and BP SE. The SoapWSATCompositApp exposes the same transacted WSDL operations (having the same WS-AT policy assertions) as that of the SimpleService and will serve as a proxy to the SimpleService. The HTTP/SOAP BC simply propagates the imported WS-AT transaction to the BP SE and the BP SE invokes the SimpleService web service via the HTTP/SOAP BC. For transaction propagation to work, the BPEL "process" element has the "{http://www.sun.com/wsbpel/2.0/process/executable/SUNExtension/Transaction}atomic" attribute set to "yes".
  • SimpleService, a web service implemented as a Java servlet with transacted operations. The Edit Web Service Attributes feature in the NetBeans IDE WSIT plug-in is used to configure Transaction Attributes of each web service operation. The SampleServiceClient does not interact directly with this web service. However it interacts with the SoapWSATCompositeApp web service which in turn interacts with the SimpleService.
  • SimpleServiceASCMTEJB, a web service implemented as container-managed transaction enterprise bean (CMT EJB). No configuration is necessary for this case.
  • LibraryFacadeWebServiceBean, a web service that uses the Java Persistence API (JPA) with two JDBC resources
  • Managed Java EE resources participating in a distributed transaction having its transacted updates all committed or rolled back

The SimpleService web service and CMT EJB transacted web service operations manipulate two JMS resources:

  • jms/ConnectionFactory, an XATransaction connection factory
  • jms/Queue, a JMS queue

The LibraryFacadeWebServiceBean web service operations manipulate the JDBC resources:

  • connectionPool, an XATransaction JDBC connection pool
  • jdbc/javaProgrammingLibrary, a JDBC connection resource

This test case shows how to use transaction with HTTP/SOAP BC and BP SE (with BP process atomic="yes"). To validate the test, XATransaction-enabled JMS and JDBC resources are used. The SampleServiceClient client is configured to run on one GlassFish instance (domain2) and the service running on the other GlassFish instance (domain1).

JSPWiki v2.4.100
[RSS]
« Home Index Changes Prefs
This particular version was published on 12-Mar-08 17:10 PM, -0700 by jamestran