15 About Connection Pooling

Learn about the connection pool functionality in Oracle Communications Billing and Revenue Management (BRM).

Topics in this document:

Overview

A connection pool is a set of connections maintained between an application, such as Conversion Manager, and the Connection Manager (CM). An incoming request is assigned a connection from this pool and uses the connection to perform operations. When the operation completes, the connection is returned to the pool.

If an incoming request cannot be assigned a connection immediately, the request is queued. The request waits for a connection to become available for a configurable period of time. If a connection doesn't become available during this time, an exception is thrown indicating that the request timed out.

Connection pooling includes these features:

  • Automatic connection pool resizing

  • Automatic removal and replacement of bad connections

  • Automatic connection attempt retries (failover)

  • Timeout management

Configuring the Connection Pool

You configure the connection pool by using attribute-value pairs in the application's Infranet.properties file.

Note:

For the location of the Infranet.properties file, descriptions of any application-specific parameters, and parameter default values, see the appropriate application documentation.

Infranet.properties File Connection Pool Parameters

Table 15-1 describes the configurable connection pool parameters in the Infranet.properties file.

Table 15-1 Configurable Connection Pool Properties

Parameter Description

infranet.connectionpool.maxsize

The maximum number of connections the connection pool maintains.

infranet.connectionpool.minsize

The minimum number of connections the connection pool maintains.

Note: When you first start the connection pool, it may have fewer connections than the minsize value. When the minsize number of connections is reached, the number of connections will not fall below this count.

infranet.connectionpool.timeout

The time in milliseconds that a connection request will wait in the pending request queue for a free connection before it times out. If a pending request doesn't receive a connection during this time, an exception is thrown.

infranet.connectionpool.maxidletime

The time in milliseconds that an idle (unused) connection remains in the connection pool before it is removed.

Important: If the value is set too low, connections might be removed and restored too frequently. This can degrade system performance.

Connection Pool Error Handling

Connection pool handles errors by throwing determinate exceptions. These exceptions, derived from the DeterminateException class, specify causes for connection failure as shown in Table 15-2:

Table 15-2 Connection Pool Error Handling

Reason for exception thrown Description

CONNECT_PARSE_ERROR

Thrown when parsing the property file name-value pairs results in errors.

CONNECT_TIMED_OUT

Thrown when a connection cannot be returned from a pool due to request-timeout.

CONNECTION_COULD_NOT_BE_ESTABLISHED

Thrown when there are no connections available and the pool is expanding in size. The additional connections had problems establishing connections to BRM.

CONNECTION_NO_LOGIN_INFO

Thrown when the connections created cannot log on to BRM.

CREATE_ERROR

Thrown by any createInstance APIs if the static instance is already created.

WAIT_ERROR

Thrown when a connection is in the request queue.

Note:

  • To find the reason for the exception, use this line in your code:

    get toString()
  • If an exception is thrown, the calling code is responsible for issuing a new connection request.

Monitoring Connection Pooling Events

When a request is assigned a connection or a connection request times out, the connection pool messages are recorded in the log file.