You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Christopher Schultz <ch...@christopherschultz.net> on 2020/01/06 16:05:13 UTC

Re: [OT] JDBC connection pooling maxActive or MaxTotal

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Zahid,

On 1/3/20 18:50, zahid wrote:
> Is commons-dbcp-2.x   a Database pooling component for any
> container Jetty,Jboss tomcat   etc. ?

Yes. Tomcat ships with a shaded (package-renamed) version of
commons-dbcp as well as tomcat-pool, a separate connection-pool
implementation.

> is commons-dbcp-2.x a third option, separate option from the two
> pooling options [tomcat-pool and commons-pool] you mentioned ?

No, I misspoke and said commons-pool. commons-dbcp is based upon
commons-pool which is a generic pooling framework. The "dbcp" flavor
provides pooling (unsurprisingly) of JDBC connections. The
commons-pool reference was meant to be the bundled version of
commons-dbcp that Tomcat already provides.

Thanks,
- -chris

> On 03/01/2020 23:21, Dave Bothwell wrote:
>> Chris,
>> 
>> That was very helpful.
>> 
>> Thank you Dave
>> 
>> 
>> 
>> On Fri, Jan 3, 2020 at 5:29 PM Christopher Schultz < 
>> chris@christopherschultz.net> wrote:
>> 
> Dave,
> 
> On 1/3/20 13:47, Dave Bothwell wrote:
>>>>> I am using Tomcat 8.5.11 with JDBC connection pooling.
>>>>> Based on the documentation it is clear that DBCP pooling
>>>>> has changed the maxActive attribute to maxTotal. However it
>>>>> is unclear, based on this document 
>>>>> https://tomcat.apache.org/tomcat-8.5-doc/jdbc-pool.html, if
>>>>> JDBC pooling has also changed maxActive to maxTotal.
>>>>> 
>>>>> my question is which attribute should I be using?
> Are you asking about the difference between configurations for 
> tomcat-pool and commons-pool?
> 
> commons-pool (which is the default connection-pool in Tomcat) uses 
> maxTotal.
> 
> tomcat-pool (which is NOT the default connection-pool in Tomcat)
> uses maxActive.
> 
>>>>> Also, I am currently using both attributes maxActive and
>>>>> maxTotal in my current server.xml file, which does not
>>>>> appear to be causing any issues.
> If you use both, you should be all set for whichever pool you use
> at runtime. Note that you will have to specifically enable
> tomcat-pool, so it's unlikely that the pooling-library in use will
> be a surprise.
> 
> If you look in your log file, you will notice that when Tomcat
> starts up it will give you a warning that one of the two
> configuration options failed to apply to whichever pool you are
> using. It is a warning, not an error, so you can ignore it. But it
> will show up in your log file every time.
> 
> -chris
>>> 
>>> --------------------------------------------------------------------
- -
>>>
>>> 
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>> 
>>> 
-----BEGIN PGP SIGNATURE-----
Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/

iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAl4TWrkACgkQHPApP6U8
pFibBw/+Mpzeueng9m+w+T19rZM3TG8MCToGHY1oqzrC59p3dIogcFW8qneEQhqd
+Ah3Fz7G8aclSuWdJYLoqXm3vnmyWlfUM7qlDKIVyIb1AyWfdP0OqmWU2ze4WFLn
jUmwVyX4F0K0AcnzFLxfQpZHK/0LS17tgig6ZwVZW1Wwu8zULOKavfnuDTl4mMwK
qqJznL3wMLvU2mTWlWEKWIhCusLi2xmHWTh/rT0hl4r+WqhRDVyFEzC4Yl1XJTFJ
IvyZcvSYPpHfvqg5OR15SlOwJbGxIhn1lyP5KrjciIy6zir4MdFp/8WsCKPF9MBW
7vxXf1fzoahGWkmbo6hgfpWnw7jOjq+bvAFGp6k287dXpJO6duIvqkIjfosZUTsU
0MoWtug3CTWz0E5bYLDZ4zo7+qyFVYzccUcSdXtjwUOmg+ln0VzXbPxpCB62Fk+/
SK7/ukHC9Ovy3upf5aMLSNDCDrl1/3I0tSuXz1lfObxqto0HZH3gho4mzKt1vnVc
iECw0NBGD53lBC5FQ/KuUgn24DGgQlrU171KQV8h/YGrdj+PxYKDwsAdP7i00bzg
7upQ2oMdG4tzsFI7kXD178bVZgqUHLJ+1j5yI0nFGx3cRc47K79IRQj5Sxp4gw0W
/0iRr9zhRWWvKsvICNyU86o269gPAuHbc1bGLOtV26DoKORaH1g=
=RY/K
-----END PGP SIGNATURE-----

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