This documentation is for WSO2 ESB version 4.5.1. View documentation for the latest release.

Transaction Mediator

The Transaction Mediator can provide transaction facility for a set of mediators defined as its child mediators. The Transaction Mediator with the action new indicates the entry point for the transaction. A transaction is marked completed by the Transaction Mediator with the action commit. The suspend and resume actions are used to pause a transaction at some point and start it again later. Additionally, the Transaction Mediator supports three other actions:

  • use-existing-or-new
  • fault-if-no-tx
  • rollback


Syntax

<syn:transaction action="commit|fault-if-no-tx|new|resume|suspend|rollback|use-existing-or-new" />

UI Configuration

Action:

  • Commit transaction (commit) - Ends the transaction.
  • Fault if no transaction (fault-if-no-tx) - Goes to error handler if no transaction.
  • Initiate new transaction (new) - Entries point for new transaction.
  • Resume transaction (resume) - Resumes a paused transaction.
  • Suspend transaction (suspend) - Pauses a transaction.
  • Rollback transaction (rollback) - Rollback a transaction.
  • Use existing or initiate transaction (use-existing-or new) - If a transaction already exists, continue it or create a new transaction.

Note

You can configure the Mediator using XML. Click on "switch to source view" in the "Mediator" window.


Example