TSUCK Member since 2010 116 posts
Posted: 10 months ago
Last activity: 9 months 2 weeks ago

Commons DBCP vs Tomcat JDBC Pool


There was a pretty big change made in Tomcat as to JDBC connection pool facility. Tomcat has updated its default connection pooling library to Tomcat JDBC Pool ("tomcat-jdbc-pool") in Tomcat 8. Tomcat 7 and earlier version used Commons DBCP ("commons-dbcp"). For example, Tomcat JDBC Pool uses "maxTotal" instead of "maxActive" to limit the number of connections. In order to enable this new feature Tomcat JDBC Pool, you need to add factory attribute in your context.xml. In summary,

  1. If you are using Tomcat 7, you can use maxActive & maxWait.
  2. If you are using Tomcat 8, you should use maxTotal & maxWaitMillis.
  3. If you are using Tomcat 8, you should also add factory attribute as follows:


Is my understanding above correct? If yes, here is my proposal to installation guide creation team:

The guide should state above as a note because it is pretty important (if you misuse wrong parameters, for example misusing maxActive in Tomcat 8, then your setting will be ignored). Currently 7.4 installation guide talks about only maxActive instead of maxTotal, and 8.3 guide does not state the importance of factory attribute - I have already seen a couple of customers misusing incorrect parameters. I am suspecting that this confusion may even cause another severe error (

[7.4 installation guide]

Isn't this wrong?

[8.3 installation guide]

It will be better to write some explanation of the importance of factory attribute in Tomcat 8x or people may just copy old settings from prior version environment and forget it.

Let me know if my suggestion makes sense or not.


***Edited by Moderator: Lochan to update SR details***

Data Integration System Administration SR Created
Share this page LinkedIn