Project: Tomcat
Bug 51893 JMX notification/Exception for empty/exhausted connection pool
Reported: 2011-09-26 14:49:49 | Status: resolved fixed

Currently, if there is an error getting a connection from the pool, a generic SQLException is thrown. The only way to determine if the problem is a result of the connection pool being exhausted is to catch the SQLException and parse the message (i.e. look for "Pool empty" in ex.getMessage()). Would like to see the following: 1) A subclass of SQLException thrown in the case of an empty pool 2) A JMX notification sent in the case of an empty pool (e.g. [POOL EXHAUSTED])

Files changed in fix:
modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PoolExhaustedException.java modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/jmx/ConnectionPool.java