Changing connection pool settings in Java SE

In a Java™ SE environment, you can change the parameters of the connection pool in the ra.xml deployment descriptor, for example to fine-tune performance.

About this task

In Java SE configurations, the execution unit (XU) uses the defaultConnectionManagerProperties property as part of its own implementation of the Java ConnectionManager interface.

Procedure

  1. Add a ra.xml file anywhere on the class path. You can find a template in the product installation directory: <InstallDir>/executionserver/bin/ra.xml
    <InstallDir> is the product installation directory.
  2. Find the defaultConnectionManagerProperties property.
    <config-property>
    <config-property-name>defaultConnectionManagerProperties</config-property-name>
    <config-property-type>java.lang.String</config-property-type>
    <config-property-value>pool.maxSize=20,pool.waitTimeout=-1</config-property-value>
    </config-property>
  3. Replace the default value pool.maxSize=20 with one or all of the following properties:
    • pool.maxSize=<maxNumber>, where <maxNumber> is the maximum number of connections in the pool.
    • pool.class=<poolClass>, where poolClass is the name of the class that implements the IlrPool interface.
    • pool.waitTimeout=<maxNumber>, where <maxNumber> is the maximum number of milliseconds before an attempt at retrieving an instance from the pool fails. The default value is -1. This value means that the process does not wait: if no instance is available from the pool, an exception is thrown.
      Attention: The 0 value means infinite timeout. Use this value with extreme caution because if the pool is overloaded, it might cause some threads to hang in the system.
  4. Optional: Enable the connection maintenance task:
    • connection.maintenancePeriod=<period>
    • connection.idleTimeout=<maxIdle>

    For the best performance, the connection pool keeps unused connections free, so it can reuse them quickly. If a ruleset changes frequently or numerous different rulesets are run, keeping an unused connection might retain unrequired memory. The pool maintenance task provides a way to free an unused connection early. You control the pool maintenance task with the following properties:

    • connection.maintenancePeriod: The interval in seconds between runs of the maintenance task. Unset by default, the maintenance task does not run. When the pool maintenance task runs, it discards any connections remaining unused for longer than the time value specified in connection.idleTimeout property.
    • connection.idleTimeout: Specifies the interval in seconds after which an idle connection is discarded. Set the idle timeout value, <maxIdle>, to a value that is larger than the maintenancePeriod value for optimal performance. By default, the value is not set.
  5. Save the deployment descriptor.