On 07/10/2015 19:54, Bradley Wagner wrote:
> Did not what?
> 
> We added "factory='org.apache.tomcat.jdbc.pool.DataSourceFactory'". That
> switched us to Tomcat DBCP, correct?

No. There is no such thing as Tomcat DBCP.

There is Apache Commons DBCP 1. This is used by default in Tomcat 6.0.x
and 7.0.x.

There is Apache Commons DBCP 2. This is used in default Tomcat 8.0.x.

Commons DBCP is packaged renamed to avoid class loading conflicts if the
web application includes a copy of Commons DBCP in WEB-IN/lib.

There is also the Tomcat JDBC connection pool. This is entirely separate
from DBCP. For the full history, read this [1].

> At that time, we were using the updated "maxWaitMillis" and "maxTotal" in
> our context.xml and Tomcat didn't seem to complain on startup.
> 
> Then, when we tried to set "maxWaitMillis" on a manually created Tomcat
> DBCP dataSource:
>  "<bean id="dataSource" class="org.apache.tomcat.jdbc.pool.DataSource"
> destroy-method="close">" in a test at which point we got an error about
> that class not having a 'maxWaitMillis' setter.
> 
> Was the Tomcat DBCP we were using in our context.xml just failing silently
> or ignoring the 'maxWaitMillis' and 'maxTotal' params and we didn't realize
> it?

I suspect Tomcat was changing the names as required under the covers
without telling you anything.

> Are the params here:
> https://tomcat.apache.org/tomcat-8.0-doc/jdbc-pool.html mean to be the
> definitive ones for Tomcat DBCP?

Those are for Tomcat JDBC. There is no Tomcat DBCP.

Mark


[1] http://markmail.org/message/nhayhdcstkj2lssf

> 
> On Wed, Oct 7, 2015 at 2:46 PM Konstantin Kolinko <knst.koli...@gmail.com>
> wrote:
> 
>> 2015-10-07 21:36 GMT+03:00 Bradley Wagner <bradley.wag...@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-unsubscr...@tomcat.apache.org
>> For additional commands, e-mail: users-h...@tomcat.apache.org
>>
>> --
> 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-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to