tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Konstantin Kolinko <knst.koli...@gmail.com>
Subject Re: DBCP params different for the Tomcat DBCP implementation in Tomcat 8?
Date Wed, 07 Oct 2015 18:45:54 GMT
2015-10-07 21:36 GMT+03:00 Bradley Wagner <bradley.wagner@hannonhill.com>:
> 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.

No, you did not. The above factory is for "Tomcat JDBC" pool implementation.

It was inspired by DBCP1, but is different from both Commons DBCP1
(used by default in Tomcat 6, 7) and Commons DBCP2 (used by default in
Tomcat 8).

> 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>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message