JBoss.orgCommunity Documentation

Chapter 7. Connection Pooling

7.1. Overview
7.2. Framework Overview
7.3. Using Connection Pooling
7.4. The Connection Lifecycle
7.4.1. XAConnection Pooling
7.5. Configuring the Connection Pool

The Query Engine logically obtains and releases a connection for each command that is executed.

However many enterprise sources maintain persistent connections that are expensive to create. For these situaions, Teiid provides a transparent connection pool to reuse rather than constantly release connections.  The connection pool is highly configurable through configuration properties and extension APIs for Connections and Connectors

Many built-in connector types take advantage of pooling, including JDBC, Salesforce, and LDAP connectors.

The table below lists the role of each class in the framework.

Automatic connection pooling does not require any changes to basic Connector development. It can be enabled by setting the Connector binding Property ConnectionPoolEnabled=true or by adding the ConnectionPooling annotation, which defaults to enabled=true, to the Connector implementation class. Automatic Connection pooling can be disabled if either setting is false.

Connector developers can optionally utilize the PoolAwareConnection and ConnectorIdentityFactory interfaces to refine the Connector's interactions with Connection pooling. It is important to consider providing an implementation for PoolAwareConnection.isAlive to indicate that a Connection is no longer viable and should be purged from the pool. Connection testing is performed upon leases from the pool and optionally at a regular interval that will purge idle Connections. It is also important to consider having the concrete Connector class implement ConnectorIdentity factory if Connections are made under more than just a single identity.

These steps occur when connection pooling is enabled:

The ConnectionPool has a number of properties that can be configured via the connector binding expert properties.