Adapter Development Kit 6.5 | webMethods Adapter Development Kit Documentation | webMethods Adapter Development Kit Installation and User’s Documentation | Run Time Activities | Run Time Connection Allocation for Adapter Services | Partitioned Connection Pools
 
Partitioned Connection Pools
While a connection node defines a general set of connections to a given back-end resource, it is sometime necessary to connect to the backend using attributes that are specific to a particular operation or data set. For example, the backend may require that a connection be established with a specific set of user credentials in order to update a given record. If the number of unique attributes is small, it may be possible to define a connection pool with each set of attributes and select the appropriate pool at run time based on the service being called and/or the data being manipulated. When this is not practical, an adapter should implement connection pool partitioning.
A connection pool partition is a logical division within a given connection pool where connection objects in different partitions are used at different times in an adapter-defined way. Typically, connections in different partitions have different permissions, and are often associated with different users. However, the use of partitions and how they are segregated is entirely determined by the adapter implementation. Connection objects are assigned to a particular partition at the time they are created and remain in the same partition for the life of the object.
When a connection pool is started, it is initialized with connections in the default (null) partition. Additional partitions are created and populated as connections from those partitions are requested.
The process of requesting a connection from a particular partition begins in the WmAdapterService.getConnectionSpec() method. Adapter writers should extend the WmConnectionSpec class to capture any context information necessary to determine the required partition. This may include information from the invocation pipeline, as well as information about the service being invoked, including metadata parameter settings.
The WmConnectionSpec object returned by the service implementation is then passed to the getConnectionRequestInfo() method of the connection factory associated with the selected connection node. (See Enabling Connection Nodes for information on selecting a connection node for an invocation. Note that the connection node need not be identified in the WmConnectionSpec object.) The connection factory is then required to identify the connection pool partition based on the information in the WmConnectionSpec object.