Configuring connectivity to the Pega Platform database

When started, the Pega Platform opens two connections to the Pega Platform database. To be responsive to requestors, the system uses a pool of connections over time.

This task applies to databases using Pega-managed connection pooling. This task does not apply to databases that use JNDI data sources.

You can control the time-out interval and the size of the connection pool for the runtime base user, admin user, and read-only user using optional settings in the prconfig.xml file. The default connection pool sizes for a database are as follows:

  • Runtime base user – 20 connections
  • Admin user – 5 connections, if an admin user is configured
  • Read-only user – 5 connections, if a read-only user is configured

If database access is needed when all existing connections are busy, the system creates an additional connection. Connections remain open until the Pega Platform is stopped, or until they are idle for 5 minutes or longer. The value of IdleConnectionTimeout in the prconfig.xml file defines the interval, in seconds, after which an idle connection is marked to be closed.

  1. Open the prconfig.xml file with an XML or text editor.
  2. Locate the PegaRULES database user name and password entries.
  3. Add the following settings:

    Configure the connection pool size for the base user, admin user, and read-only user, 20, in the following examples.

    <env name="database/databases/<database name>/connectionPoolSize"
    value="20"/>
    <env name="database/databases/<database name>/admin/connectionPoolSize"
    value="20"/>
    <env name="database/databases/<database name>/readonly/connectionPoolSize"
    value="20"/>

    Configure the connection time-out in seconds, 30, in the following example.

    <env name="database/databases/<database name>/maxConnectionsTimeout"
    value="30"/>
  4. Save the updated file.
  5. Undeploy and redeploy the system to make this change effective.
Result: 
Note: You can also use dynamic system settings to configure your application.

If the limit is reached and all connections are busy when an additional database request arrives, the requestor waits. If a connection is not available after 10 seconds (or the interval set in the maxConnectionsTimeout value), a Java DatabaseException is thrown.

CAUTION:
Do not set this limit too low, or deadlocks and poor response may result. You can set a threshold for PEGA0026 alerts to detect long waits.