To update the connection pool configuration for a JDBC resource, use the following rhino-console command or related MBean operation.

Console command: setjdbcresourceconnectionpoolconfig

Command

setjdbcresourceconnectionpoolconfig <name> [-max-connections max-size]
[-min-connections size] [-max-idle-connections size] [-max-idle-time time]
[-idle-check-interval time] [-connection-pool-timeout time]
  Description
    Update the connection pool configuration of a JDBC resource. Size parameters
    must be integer values. The max-idle-time and idle-check-interval parameters are
    measured in seconds and must be integer values. The connection-pool-timeout
    parameter is measured in milliseconds and must be a long value.

Example

In the example below, the maximum idle connections is set to 20, the maximum number of connections is set to 30, and the maximum time an idle connection remains in the connection pool is set to 60s:

$ ./rhino-console setjdbcresourceconnectionpoolconfig myresource \
        -max-idle-connections 20 -max-connections 30 -max-idle-time 60
Connection pool configuration updated for JDBC resource myresource
$ ./rhino-console dumpjdbcresourceconnectionpoolconfig myresource
connection-pool-timeout : 5000
idle-check-interval     : 30
max-connections         : 30
max-idle-connections    : 20
max-idle-time           : 60
min-connections         : 0

MBean operations:

getJdbcResourceConnectionPoolConfigMBean

MBean

Rhino operation

public ObjectName getJdbcResourceConnectionPoolConfigMBean(String jndiName)
    throws NullPointerException, NameNotFoundException,
      InvalidStateException, ConfigurationException;

This method returns the JMX ObjectName of a JDBC Resource Connection Pool Management MBean, which can be used to manage the connection pool configuration parameters.

JDBC Resource Connection Pool Management

MBean

Rhino operations

public void setMaxConnections(int maxConnections)
    throws ConfigurationException;

public void setMinConnections(int minConnections)
    throws ConfigurationException;

public void setMaxIdleConnections(int maxIdleConnections)
    throws ConfigurationException;

public void setMaxIdleTime(int maxIdleTime)
    throws ConfigurationException;

public void setIdleCheckInterval(int idleCheckInterval)
    throws ConfigurationException;

public void setConnectionPoolTimeout(long timeout)
    throws ConfigurationException;

These methods set a new value for the corresponding connection pool configuration parameter.

Previous page Next page
Rhino Version 2.6.1