You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Woonsan Ko <wo...@apache.org> on 2016/05/24 22:23:44 UTC

JNDI DataSource in Tomcat 8: maxTotal and maxWaitMillis

Hi,

Since 8.0, I think we should use maxTotal instead of maxActive and
maxWaitMillis instead of maxWait. [1,2]
However, if I use maxTotal for instance, the jmx console doesn't show
it but show the old maxActive value (100, probably the default
value?).
Browsing the source, o.a.t.jdbc.pool.PoolConfiguration doesn't seem to
consider both. o.a.t.jdbc.pool.DataSourceFactory#parsePoolProperties(Properties)
seems even unaware of those new properties.
Would this be a bug in either code or documentation?

Another question is, why does it ignore 'poolPreparedStatements'
parameter even though it's supported by the underlying dbcp?

Regards,

Woonsan

[1] https://tomcat.apache.org/migration-8.html#Database_Connection_Pooling
[2] http://tomcat.apache.org/tomcat-8.0-doc/jndi-datasource-examples-howto.html

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


Re: JNDI DataSource in Tomcat 8: maxTotal and maxWaitMillis

Posted by Woonsan Ko <wo...@apache.org>.
Hi Mark,

On Wed, May 25, 2016 at 4:56 AM, Mark Thomas <ma...@apache.org> wrote:
> On 24/05/2016 23:23, Woonsan Ko wrote:
>> Hi,
>>
>> Since 8.0, I think we should use maxTotal instead of maxActive and
>> maxWaitMillis instead of maxWait. [1,2]
>> However, if I use maxTotal for instance, the jmx console doesn't show
>> it but show the old maxActive value (100, probably the default
>> value?).
>> Browsing the source, o.a.t.jdbc.pool.PoolConfiguration doesn't seem to
>> consider both. o.a.t.jdbc.pool.DataSourceFactory#parsePoolProperties(Properties)
>> seems even unaware of those new properties.
>> Would this be a bug in either code or documentation?
>>
>> Another question is, why does it ignore 'poolPreparedStatements'
>> parameter even though it's supported by the underlying dbcp?
>
> You are mixing up the two connection pooling options. The default DBCP
> based one (org.apache.tomcat.dbcp.dbcp2) and the Tomcat implementation
> (org.apache.tomcat.jdbc).
>
> Which one are you actually using?

Thank you very much for asking the right question! :-)
Indeed, I overlooked the factory attribute in the existing
configuration. The DataSource configuration contained the following:

    factory="org.apache.tomcat.jdbc.pool.DataSourceFactory"

My bad. I should have taken a closer look at it. After removing the
attribute to use the default factory
(org.apache.tomcat.dbcp.dbcp2.BasicDataSourceFactory), it works like a
charm!

Cheers,

Woonsan

>
> Matk
>
>
>>
>> Regards,
>>
>> Woonsan
>>
>> [1] https://tomcat.apache.org/migration-8.html#Database_Connection_Pooling
>> [2] http://tomcat.apache.org/tomcat-8.0-doc/jndi-datasource-examples-howto.html
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>

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


Re: JNDI DataSource in Tomcat 8: maxTotal and maxWaitMillis

Posted by Mark Thomas <ma...@apache.org>.
On 24/05/2016 23:23, Woonsan Ko wrote:
> Hi,
> 
> Since 8.0, I think we should use maxTotal instead of maxActive and
> maxWaitMillis instead of maxWait. [1,2]
> However, if I use maxTotal for instance, the jmx console doesn't show
> it but show the old maxActive value (100, probably the default
> value?).
> Browsing the source, o.a.t.jdbc.pool.PoolConfiguration doesn't seem to
> consider both. o.a.t.jdbc.pool.DataSourceFactory#parsePoolProperties(Properties)
> seems even unaware of those new properties.
> Would this be a bug in either code or documentation?
> 
> Another question is, why does it ignore 'poolPreparedStatements'
> parameter even though it's supported by the underlying dbcp?

You are mixing up the two connection pooling options. The default DBCP
based one (org.apache.tomcat.dbcp.dbcp2) and the Tomcat implementation
(org.apache.tomcat.jdbc).

Which one are you actually using?

Matk


> 
> Regards,
> 
> Woonsan
> 
> [1] https://tomcat.apache.org/migration-8.html#Database_Connection_Pooling
> [2] http://tomcat.apache.org/tomcat-8.0-doc/jndi-datasource-examples-howto.html
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 


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