tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bradley Wagner <bradley.wag...@hannonhill.com>
Subject DBCP params different for the Tomcat DBCP implementation in Tomcat 8?
Date Wed, 07 Oct 2015 18:36:32 GMT
Hi,

We recently upgraded to Tomcat 8. As per the Migration Guide:
https://tomcat.apache.org/migration-8.html#Database_Connection_Pooling and
DBCP documentation
https://tomcat.apache.org/tomcat-8.0-doc/jndi-datasource-examples-howto.html#Database_Connection_Pool_(DBCP_2)_Configurations,
we switched to using the new param values like: maxTotal and maxWaitMillis.

Then, we switched to using the Tomcat DBCP by adding
factory="org.apache.tomcat.jdbc.pool.DataSourceFactory". Tomcat did not
seem to have a problem with using Tomcat DBCP with the updated param names.

Then, I modified a test we were running to also use  a Spring initialized,
Tomcat DBCP DataSource:

<bean id="dataSource" class="org.apache.tomcat.jdbc.pool.DataSource"
destroy-method="close">

Now, our test is complaining with: "Bean property 'maxWaitMillis' is not
writable or has an invalid setter method." because we were using the new
style param name:

<property name="maxWaitMillis" value="5000"/>

So now I'm confused.

1. Does Tomcat DBCP (in Tomcat 8) indeed use different params than the new
DBCP2 that ships with Tomcat 8?
2. Why did Tomcat not complain when I was using maxWaitMillis with the
updated factory="org.apache.tomcat.jdbc.pool.DataSourceFactory" but does
complain when I try to instantiate that pool implementation's DataSource
directly?
3. Is there some other way that I should be instantiating the Tomcat DBCP
DataSource in my test that would be more appropriate?

I searched the archives and couldn't find mention of this.

Thanks!


-- 
Bradley Wagner
VP Engineering, Hannon Hill
www.hannonhill.com | Twitter <https://twitter.com/hannon_hill> | Github
<http://github.com/hannonhill>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message