Adapter Development Kit 9.12 | webMethods Adapter Development Kit Documentation | webMethods Adapter Development Kit Installation and User’s Documentation | Integration Server Transaction Support | Implicit Transaction Usage Cases
 
Implicit Transaction Usage Cases
Integration Server handles implicit transactions. For a flow to be managed implicitly, it can contain one of the following:
*One local transaction, interacting with one resource.
*One or more XAResource transactions; each transaction can interact with one or more resources.
*One or more XAResource transactions and one local transaction.
If a flow contains multiple local transactions, the adapter user must explicitly control the transactional units of work. For more information, see Explicit Transaction Usage Cases.
Following are examples of implicit transactions.
One Local Transaction
In this example, a flow with two adapter services interacts with the same local transaction resource. The flow performs two inserts into two tables of a database:
BEGIN FLOW
INVOKE insertDatabase1TableA // Local Transaction Resource1
INVOKE insertDatabase1TableB // Local Transaction Resource1
END FLOW
*Integration Server starts the transaction when insertDatabase1TableA is invoked.
*Integration Server opens a connection to the resource, enlists it in the transaction, and performs the insert into TableA.
*When insertDatabase1TableB is invoked, Integration Server reuses the same connection to insert data into TableB.
*When the request is complete, Integration Server closes the connection and commits the transaction.
Two Local Transactions
The following flow is invalid because it tries to interact with two local transaction resources as follows:
BEGIN FLOW
INVOKE insertDatabase1TableA // Service for Resource1
INVOKE insertDatabase2TableA // Service for Resource2
END FLOW
Three XAResource Transactions
The following flow is valid because a flow can contain any number of XAResource transactions.
BEGIN FLOW
INVOKE insertDatabase1TableA // XAResource Transaction Resource1
INVOKE insertDatabase2TableA // XAResource Transaction Resource2
INVOKE insertDatabase3TableA // XAResource Transaction Resource3
END FLOW
One Local Transaction and One XAResource Transaction
Continuing with the previous case, this flow contains an additional insert to a different database that accepts XAResource transactions as follows:
BEGIN FLOW
INVOKE insertDatabase1TableA // Local Transaction Resource1
INVOKE insertDatabase1TableB // Local Transaction Resource1
INVOKE insertDatabase2TableA // XAResource Transaction Resource1
END FLOW
*When Integration Server invokes insertDatabase2TableA, a transaction is already in progress with the first database enlisted. Integration Server performs the following:
*Establishes a second connection to Database2.
*Enlists the new connection in the XAResource transaction.
*Performs the insert to tableA.
*When the request is complete
*Integration Server closes both connections.
*Transaction Manager performs a local commit for the non-XAResource and then a two-phase commit for the XAResource enlisted in the transaction.