You have already established that the 'disconnect after certain idle time' setting works for bonecp. Now you need to analyze your code to see why is it taking up multiple connection objects for a single request (assuming that what's happening here). You don't need 4 test clients for this. Fire up your app and without sending across requests check how many connection objects are created. After that just send across a single request and then check how many connection objects you have.
It's quite possible that bonecp initializes all the connections eagerly resulting in a full pool. So basically from this point it's either:
- Your app isn't releasing connections in a timely manner
- Your bonecp configuration is causing the eager initialization of the entire pool