The jdbc command manages the connection pool
associated with a JDBC Provider.
The jdbc command uses the following format:
jdbc <providername> clear [-t <timeout>]
or
jdbc <providername> limits [-idle <maxidle>] [-active <maxactive>]
Clear
The clear option closes and removes connections from the
connection pool.
- provider name. The name of the JDBC provider toward
which the command is directed.
- timeout. The maximum time, in seconds. where the clear
command blocks waiting for active connections to be returned to
the pool. The default setting is to wait indefinitely.
Notes:
- Execution of this command drops all connections from the
pool, but leaves the pool itself intact. Thus, when the next user
attempts to borrow a connection from the pool, a new connection
will be added to the pool for that user. This means that if a user
wants the pool to remain empty for some period of time, channels
that use the pool should be stopped before the command runs.
- The pool cannot be cleared completely until all active connections
have been returned. If a timeout is not specified, this command
will block until all connections have been returned to the pool
and closed. If a component borrows a connection from the pool but
does not return it-for example, XDSQL Agent using the JDBC provider
along with the agent's own connection caching facility-the command
would block indefinitely. Avoid this situation by stopping all channels
that use the pool before executing this command.
- While the command is actually executing, callers will be unable
to borrow connections from the pool. Any attempt will result in
an SQL Exception with the message, unable to get pooled connection
from this provider. Once all connections have been cleared,
however, the pool will become available, as described above.
Limits
The limits option can reset the limits of the pool for
the maximum number of idle connections and the maximum number of
active connections.
- provider name. The name of the JDBC provider toward
which the command is directed.
- idle. New value for maximum number of idle connections
to retain in the pool.
- active. New value for maximum number of active connections
allowed by the pool.
Notes:
- You must supply at least one of the idle or active options.
- The maximum number of idle connections must always be less than
or equal to the maximum number of active connections.
- This command changes only the runtime values of these limits.
When restarting iSM, the pool will initialize with the previously
saved values.
- This command does not affect connections currently in the pool.
After resetting the maximum number of idle connections, the pool
can contain more idle connections than the new value, until these
connections are borrowed and returned, reach their idle limit and
are evicted, or are removed by the clear command.