bitronix/btm — pull request #34 by rankinc (2014-06-02 16:32:19+00:00)
Title: Implement XAPool.availablePool as LIFO instead of FIFO.

An application that frequently requests a connection for a brief interval can quickly iterate through a FIFO available pool, preventing any of them from reaching BTM's configured "max idle time" interval. This prevents the available pool from shrinking, even when it contains many more connections than are actually needed. So reimplement the pool as LIFO instead. This allows surplus connections to sink to the bottom of the pool and expire naturally.

Note that poll() and pollFirst() are synonymous, as are add() and addLast(). However, being explicit is a Good Thing.