MikeFHay
MikeFHay

Reputation: 9023

What can cause a GenericObjectPool to drop objects?

In the system I am currently working on, we are using an Apache Commons GenericObjectPool as our Oracle connection pool. We've noticed recently that instead of all connections being kept perpetually and re-used, the number of connections in the pool rises and falls as if the connections are being dropped. At no point in the code are we calling the clear() or evict() methods, and the testOnBorrow and testOnReturn flags are both set to false. What else could be causing the objects to be dropped?

Upvotes: 1

Views: 1278

Answers (1)

MikeFHay
MikeFHay

Reputation: 9023

Solved this as I was writing it. Although we were setting maxActive to our preferred pool size, we were not setting the maxIdle property, which defaults to 8, so any time more than 8 connections were idle, they were dropped.

Upvotes: 2

Related Questions