Show TOC

Background documentationConnection Pooling Locate this document in the navigation structure

 

The Connector Container Service in the AS Java provides support for pooling EIS connections, which can be reused.

You can configure the connection pooling for each ManagedConnectionFactory at deployment time.

Activities

You can set the parameters of a connection pool for a resource adapter in its additional deployment descriptor (connector-j2ee-engine.xml) using the <pool-params> element and its child elements.

You can manage the following parameters:

  • max-connections-number — this defines the maximum number of connection instances that can be stored in the connection pool

  • max-time-to-wait-connections — using this parameter you can define how many seconds the system waits for a connection to be released if there are no free connections and the maximum number of pooled connections is already achieved. The system throws an exception after this interval.

  • connection-lifetime — use this parameter to define how many seconds a connection may stay in pool before it is closed

  • run-cleanup-thread — using this parameter you can schedule a thread that periodically cleans up unused connection objects at a regular interval that you set in seconds.

    Example Example

    1. <pool-params>
      <max-connections-number>10</max-connections-number>
      <max-time-to-wait-connections>120</max-time-to-wait-connections>
      <expiration-control>
      <connection-lifetime>600</connection-lifetime>
      <run-cleanup-thread>300</run-cleanup-thread>
      	</expiration-control>
      </pool-params>
      
    End of the code.