webMethods Adapter Runtime 10.7 | webMethods Adapter Runtime Documentation | webMethods Adapter Runtime User’s Documentation | Overview of the Adapter Runtime | Adapter Connections | Run-Time Connection Allocation for Adapter Services
 
Run-Time Connection Allocation for Adapter Services
 
Dynamically Selecting a Connection Node
When an adapter service is invoked, either directly or from a flow service, the Adapter Runtime provides a connection object to the adapter service. This section describes how connections are retrieved and managed and how to dynamically control the type of connection used for each service invocation.
At run time, all connection activity for adapter services is performed inside a transaction context that holds references to connections used while the context is open. This is true regardless of whether the referenced connections are transacted. There is an implicit transaction context that begins at the invocation of a top-level flow service (such as an HTTP invocation of an Integration Server service) and continues until that top-level service exits. Additional contexts can be created using the pub.art.transaction:startTransaction service and ended using pub.art.transaction:commitTransaction or pub.art.transaction:rollbackTransaction. For more information about using these services, see Adapter Runtime Built-In Services Reference.
When the Adapter Runtime retrieves a connection from a connection pool for use by an adapter service, a reference to that connection is placed in the transaction context, and the connection is not returned to the pool until the transaction context is closed. If another adapter service call is made within the transaction context, Integration Server will first determine whether a connection from the required connection pool and partition is in the context; if so, Integration Server will use the connection from the transaction context to the adapter service instead of requesting another from the connection pool.