13.6. Idle Connections

You can configure connections to close when they are idle with the <idle-timeout-minutes/>.
Idle checking is done on a separate IdleRemover thread on a LRU (least recently used) basis. The check is done twice per idle-timeout-minutes period for connections that have not been used for idle-timeout-minutes.
The pool itself operates on an MRU (most recently used) basis. This allows the excess connections to be easily identified.
Should closing idle connections cause the pool to fall below the min-pool-size, new connections are created.

Note

If you have long running transactions and you use interleaving (that is, do not enable track-connection-by-tx), make sure the idle timeout is greater than the transaction timeout. When interleaving, the connection is returned to the pool for others to use. If it remains unused, it still becomes a candidate for removal before the transaction is committed.