I looked at the code that handles the removing borrowed connections that
have been idle too long in the AbandonedObjectPool class.
This process is triggered when another connection is requested from the pool
( getConnection() ).  The follow is an excerpt from the AbandonedObjectPool
(borrowObject() is called by getConnection() ):
    public synchronized Object borrowObject() throws Exception {
        try {
            if (config != null
                    && config.getRemoveAbandoned()
                    && (getNumIdle() < 2)
                    && (getNumActive() > getMaxActive() - 3) ) {
                removeAbandoned();
        ...
The removeAbandoned() method will clear out 'abandoned' connections.  As
shown in the above code this will only be called if 
1) RemoveAbandoned is set to true
2) NumIdle is less than 2
3) NumActive is less than MaxActive minus 3







Reply via email to