The Pega 7 Platform may open many database connections to the Pega 7 database. When started, the system opens two connections. To provide good response to requestors, the system uses a pool of connections over time. In most cases, the pool is created and managed by the application server such as WebSphere, not by the Pega 7 Platform, but the prconfig.xml settings described here control the size of the pool and the timeout interval.
If database access is later needed at a moment when all existing connections are busy, the system creates an additional connection. Connections remain open until the Pega 7 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.)
As initially installed, the system does not limit the number of open connections created. Using an optional setting in the prconfig.xml file, you can limit the size of this pool:
<env name="database/databases/pegarules/maxConnections"
value="20"/><env name="database/databases/pegarules/maxConnectionsTimeout"
value="30"/>
Note: As an alternative to updating the prconfig.xml file, you can use Dynamic System Settings to configure your application. See Prconfig settings and classifications.
If the limit is reached and all connections are busy when an additional database request arrives, the requestor waits. After 10 seconds (or another interval set in the maxConnectionsTimeout
value), if no connection is available, 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.
For more information, see PDN article How to set the maximum number of JDBC connections to the PegaRULES database.