> >If I understand, the problem is that extra connections greater than
> >MinPoolSize are not expiring after the user load decreases.
> >A solution would be to change FbConnectionPool.CheckOut() to always
> >the connection with the greatest remaining lifetime, so that connections
> >which are about to expire are left alone long enough to actually expire
> >be removed from the pool before they are reused and have their Created
> Huummmm maybe but given he's connection string, it's no using
> the MinPoolSize facility
Right, so the pool should shrink back to a size of 0 as quickly as possible
because there is no MinPoolSize.
In Alessandro's example:
* pool starts out at size of 0,
* regular user load creates and maintains 5 connections in use,
* temporary load raises pool to 10 connections,
* return to regular load only requires 5 connections, but all 10 are being
used randomly, so none ever expire,
* eventually all users go home for the night, and the entire pool goes
unused long enough for all of the connections to expire, and pool size
returns to 0.
If CheckOut() always returns the most recently used available connection
(longest remaining lifetime), then connections which are no longer needed
will be allowed to expire and the pool will reduce back down to the minimum
size required to support the current user load.
Unless I've missed something, I think this is exactly the problem.