I have a Java service running in Tomcat that uses Tomcat's DataSource
and PoolProperties
from org.apache.tomcat.jdbc.pool as in the "Plain Ol' Java" example.
In the stage environment that has Tomcat 8.0.29 I noticed the following 2 lines in the Catalina log.
WARNING [localhost-startStop-1] org.apache.tomcat.dbcp.dbcp2.BasicDataSourceFactory.getObjectInstance Name = somedb Property maxActive is not used in DBCP2, use maxTotal instead. maxTotal default value is 8. You have set value of "50" for "maxActive" property, which is being ignored.
WARNING [localhost-startStop-1] org.apache.tomcat.dbcp.dbcp2.BasicDataSourceFactory.getObjectInstance Name = somedb Property maxWait is not used in DBCP2 , use maxWaitMillis instead. maxWaitMillis default value is -1. You have set value of "10000" for "maxWait" property, which is being ignored.
I don't see such log entries in the dev environment that has Tomcat 8.0.21.
I cannot set up the datasource as a JNDI resource and I don't see any setters corresponding to maxTotal and maxWaitMillis in PoolProperties
.
How can I set those values so that they are not ignored?
Tomcat JDBC Connection Pool and Apache DBCP are two different connection pool implementations.
In your stage environment you probably have Apache DBCP2 in classpath and Tomcat tries to use it instead of Tomcat JDBC Connection Pool.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With