Adapter Development Kit 6.5 | webMethods Adapter Development Kit Documentation | webMethods Adapter Development Kit Installation and User’s Documentation | Integration Server Transaction Support | More Complex Transactions
 
More Complex Transactions
Now suppose that a flow service (or a Java service) invokes multiple adapter services. These adapter services might interact with a single resource (such as two services that perform two inserts into a single database) or with multiple resources (such as services that synchronize a database and an ERP system).
You can have one or more connections to a single resource. If multiple connections are used, the server enlists each connection in the transaction.
When the server request is complete, Integration Server notifies the transaction manager, which closes all enlisted connections and transactions. If the service request is successful, the server commits all transactions automatically (using a two-phase commit if multiple resources are used). If the service request returns an error, the server rolls back the transaction and returns an error to the Integration Server; this causes the service to return an error.
As mentioned previously, there are cases where adapter users need to explicitly control the transactional units of work. Examples of these cases are provided in Explicit Transaction Usage Cases.
Note:
If a transaction accesses multiple resources, and more than one of the resources only supports local transactions, the integrity of the transaction cannot be guaranteed. For example, if the first resource successfully commits, and the second resource fails to commit, the first resource interaction cannot be rolled back; it has already been committed. To help prevent this problem, Integration Server detects this case when connecting to more than one resource that does not support two-phase commits. It throws a run-time exception and the service execution fails.