...
This sample demonstrates the Transaction Mediator using a sample distributed transaction. In this sample, a record is delete from one database and added to a second database. If either of the operations (deleting from the first database and adding to the other) fails, all operations will roll back, and the records will be untouched.
Also, see Transaction Mediator.
Prerequisites
For a list of prerequisites, refer to see the Prerequisites section in ESB samples setup pageSamples Setup.
Building the sample
1. First, let's take a look at the synapse configuration used for this sample.
...
- For information on creating database instances, refer to Database Instances. Refer the Sample Setup Guide to see see Setting Up the Physical Database. See ESB Samples Setup for information on how you can set up the derby Derby database server.
- For information on creating the two sample XA data sources, refer to section see Adding RDBMS Data Sources and Transaction Examples.
3. Start the ESB server and log into its management console UI (https:
//localhost:9443/carbon
). In the management console, navigate to Main Menu, click Service Bus and then Source View. Next, copy and paste the above synapse configuration, which helps you explore the example scenario, to the source view
4. Deploy the back-end service SimpleStockQuoteService, and start the Axis2 server using the instructions given in section Starting Sample Back-End Services.
Info | ||
---|---|---|
| ||
WSO2 ESB comes with a default JTA transaction manager (Atomikos), which allows you to run distributed transactions without deploying the ESB on an external application server. |
...
We run this setup using the sample Stock Quote Client, which can operate in several modes. For information on this sample client, refer to section Stock Quote Client.
Execute the following ant command to invoke the sample client.
...