How to disable the idleRemover for a JCA connection pool in JBoss EAP

Solution Verified - Updated

Environment

  • Red Hat JBoss Enterprise Application Platform 5
  • Red Hat JBoss Enterprise Application Platform 6
  • Red Hat JBoss Enterprise Application Platform 7
  • idle-timeout-minutes as defined in
    • jboss-as-datasources_1_0.xsd
    • jboss-as-datasources_1_1.xsd
    • jboss-as-datasources_1_2.xsd
    • wildfly-datasources_<version>.xsd
    • jboss-as-resource-adapters_1_0.xsd
    • jboss-as-resource-adapters_1_1.xsd
    • wildfly-resource-adapters_<version>.xsd

Issue

  • How do I disable the IdleRemover thread for a connection pool?
  • could turn idleRemover off?

Resolution

Set idle-timeout-minutes to 0 so that the pool is not registered for the IdleRemover.

Diagnostic Steps

For EAP 6 (ironjacamar 1.0.x), we can check the source code Content from github.com is not included.here:

 130    public void initialize(ManagedConnectionFactory mcf, ConnectionListenerFactory clf, Subject subject,
 131                           ConnectionRequestInfo cri, PoolConfiguration pc, Pool p)
 132    {
  : 
 193       reenable();
 194    }
  :
 264    public void reenable()
 265    {
 266       if (poolConfiguration.getIdleTimeoutMinutes() > 0)
 267       {
 268          //Register removal support
 269          IdleRemover.getInstance().registerPool(this, poolConfiguration.getIdleTimeoutMinutes() * 1000L * 60);
 270       }

For EAP 7 (ironjacamar 1.3.x/1.4.x), the same behavior can be found in Content from github.com is not included.here:

 143    public void initialize(ManagedConnectionFactory mcf, ConnectionManager cm, Subject subject,
 144                           ConnectionRequestInfo cri, PoolConfiguration pc, Pool p)
 145    {
  : 
 182       if (poolConfiguration.getIdleTimeoutMinutes() > 0) 
 183       {
 184          // Register removal support
 185          IdleRemover.getInstance().registerPool(this,
 186                                                 poolConfiguration.getIdleTimeoutMinutes() * 1000L * 60);
 187       }
Components
Category
Tags

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.