In WorldServer, you can log and identify which connections have been idle or abandoned by using the general.properties file. The general.properties file also contains values that you must change to have WorldServer monitor and log events according to your needs.
Procedure
- Open the general.properties file with a text editor.
- To enable logging connections, add this property to general.properties:
log4j.category.com.idiominc.ws.sql.ConnectionPool.CONNECTIONS=debug
- To configure the maximum number of statements that you can log for an active connection, add this property to general.properties:
database_connection_log_max_statements=1
A connection log is reset for every new transaction.
- To close idle connections, add these parameters to general.properties:
database_connection_idle_time=604800
With this property, you enable the connection pool monitor. You can configure the value, expressed in seconds, according to your needs. If set to 0 (zero), this option is ignored.
and
database_connection_leak_idle_time=1800
With this property, you can close idle leaked connections. An active connection is considered to be leaked when no query has been executed within the specified interval and the originating thread is blocked for some reason.