Using the Generic Pool to pool service instances

The Generic Pool component (see Generic Pool) manages a pool of service instances, instead of managing a pool of connections like the WebSphere(R) 4.0 connection manager does. This service enables multiple service invokers to share instances of the database services (Electronic Journal and Database Table Mapping).

The service definition file (dsesrvce.xml) defines Generic Pools. Each Generic Pool definition also includes the definitions for its initial Poolable objects. To use the Generic Pool service for different objects (to pool different objects that implement Poolable) you need to define a Generic Pool for each object.

To implement pooling for JDBC Services using the Generic Pool, complete the following steps:

  1. Define the Poolable service to be instantiated by the Generic Pool service in the service definition (dsesrvce.xml) file as given in the following example for the Electronic Journal:
    <GenericPool id="JDBCJournalServicesPool" serviceName="JDBCJournalPool" 
        initialSize="20" maxPoolSize="30" timeBetweenRetries="2000" singleTable="true"/>
  2. Define the Poolable objects that the service is to instantiate. The toolkit uses the serviceName attribute of the Generic Pool service definition to locate the definition of the Poolable object within the same file. For example, the following is the definition for the example service defined in the previous step:
    <JDBCJournal id="JDBCJournalPool" autoCommit="true" schema="TEST1">
      <column id="BRANCHNUMBER_C" dataName="accountNumber.branchNumber_c"/>
      .....
      <column id="DUETIMESTAMP" dataName="dueTimeStamp"/>
    </JDBCJournal>
    Note that the serviceName in the GenericPool definition matches the ID of the JDBCJournal definition.

    To define other JDBC Services pools, you define different Generic Pool services with each one having a different serviceName, which would identify the definition of the Poolable objects that the pool will manage.