If you want to limit the active connections in the pool you can use the <capacity> element to specify the decrementer policy - you will want MinPoolSize - read more here http://www.ironjacamar.org/doc/userguide/1.2/en-US/html/ch05.html#deploying_capacity_policies
Then set <min-pool-size> to 0, <initial-pool-size> to whatever, <idle-timeout-minutes> to the interval you want, and you should be good to go.
Thank you for your answer. I looked at the ironjacamar user guide and the use of MinPoolSize.
From the guide:
Can you explain what it means by a request in this context? Is it the next time an idle connection times out or simply the next time a connection is requested. If the latter, which connections are removed from the pool?
The idle timeout request is defined by <idle-timeout-minutes> element - e.g. how often do you want to shrink your pool. In-use connections are never timed-out of course.
So, MinPoolSize is the most aggressive policy as it will remove all idle connections for each <idle-timeout-minutes> invocation.
Well, depending on your settings of course. The Watermark policy is another option...