I'm trying to understand what maxWait is in org.apache.commons.dbcp.BasicDataSource. Documentation said that it is:
The maximum number of milliseconds that the pool will wait (when there are no available connections) for a connection to be returned before throwing an exception, or <= 0 to wait indefinitely.
But I still can't understand. I tried to google it, but my doubts only increased.
I see two ways to interpret this definition:
Please help me to understand which statement is true. Or may be there is some other definition :)
maxWait should be the time your call to get a connection will wait in the pool prior to throwing an exception when all connections are currently busy.
The behavior you describe in #2 appears to be the log abandoned timeout, which is how long a connection can be leased prior to the pool deciding it has been abandoned (not closed, which would just return it to the pool instead of actually closing it.)
Check out http://commons.apache.org/proper/commons-dbcp/configuration.html to see the abandoned settings I am referring to.