You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Dave Bothwell <db...@primepoint.com> on 2020/01/03 18:47:22 UTC

JDBC connection pooling maxActive or MaxTotal

Hello,

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.

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.

my question is which attribute should I be using?

Thanks
Dave

-- 

<https://www.primepoint.com/>

David Bothwell

Chairman of the Board, Chief technology Officer | Primepoint, LLC

Address: 2 Springside Road, Westampton, NJ 08060

Phone: 800-600-5257

<https://www.primepoint.com/>-
<https://www.facebook.com/Primepoint.Payroll.HR/>-
<https://www.instagram.com/primepointllc/>-
<https://www.linkedin.com/company/505608?trk=tyah&trkInfo=clickedVertical%3Acompany%2CclickedEntityId%3A505608%2Cidx%3A2-2-3%2CtarId%3A1447790586761%2Ctas%3Aprimepoint>
- <https://twitter.com/primepoint>- <https://vimeo.com/user55649759>

-- 
This communication, and any information or attachments contained within, 
may contain privileged or confidential information that is intended for the 
sole use of the recipient or recipients named above. If the reader of this 
message is not an intended recipient, or authorized to receive such 
messages for an intended recipient, you are hereby notified that any 
review, use, dissemination, copying, or distribution of this communication, 
or any of its contents is strictly prohibited. If you have received this 
message in error, please notify us immediately of the error by return email 
and permanently remove the original message, its contents, and any copies 
from your system. Thank you.

Re: JDBC connection pooling maxActive or MaxTotal

Posted by Guang Chao <gu...@gmail.com>.
On Sat, Jan 4, 2020 at 2:47 AM Dave Bothwell <db...@primepoint.com>
wrote:

> Hello,
>
> 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.
>
>
You can also have your own connection pooling from your application.  But
of course JNDI has advantage that it is decoupled and container supplies
the connection.


> 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.
>
> my question is which attribute should I be using?
>
> Thanks
> Dave
>
> --
>
> <https://www.primepoint.com/>
>
> David Bothwell
>
> Chairman of the Board, Chief technology Officer | Primepoint, LLC
>
> Address: 2 Springside Road, Westampton, NJ 08060
>
> Phone: 800-600-5257
>
> <https://www.primepoint.com/>-
> <https://www.facebook.com/Primepoint.Payroll.HR/>-
> <https://www.instagram.com/primepointllc/>-
> <
> https://www.linkedin.com/company/505608?trk=tyah&trkInfo=clickedVertical%3Acompany%2CclickedEntityId%3A505608%2Cidx%3A2-2-3%2CtarId%3A1447790586761%2Ctas%3Aprimepoint
> >
> - <https://twitter.com/primepoint>- <https://vimeo.com/user55649759>
>
> --
> This communication, and any information or attachments contained within,
> may contain privileged or confidential information that is intended for
> the
> sole use of the recipient or recipients named above. If the reader of this
> message is not an intended recipient, or authorized to receive such
> messages for an intended recipient, you are hereby notified that any
> review, use, dissemination, copying, or distribution of this
> communication,
> or any of its contents is strictly prohibited. If you have received this
> message in error, please notify us immediately of the error by return
> email
> and permanently remove the original message, its contents, and any copies
> from your system. Thank you.
>


-- 
I love Java <https://javadevnotes.com/java-integer-to-string-examples>

Re: [OT] JDBC connection pooling maxActive or MaxTotal

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----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


Re: JDBC connection pooling maxActive or MaxTotal

Posted by Zahid Rahman <za...@gmail.com>.
Hey Dave B. ,

My question  from chris was for your benefit.
default configuration is not the same thing as vendor neutral.

chris wrote: > If you use both, you should be all set for whichever pool
you use at
runtime. DOH !

>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.
YES IGNORE WARNINGS  BECAUSE we have not made a word connect
between generic and default and and vendor neutral and vendor specific so,
the developer  who wrote warning should be ignored , because he doesn't
know what he is doing.
but you AND chris do know  by shoving two APIs down the throat our beloved
poor little  tomcat.

>Note that you will have to specifically enable tomcat-pool,
so it's unlikely that the pooling-library in use will be a surprise. HUH!

If your are trying to use both APIs then  you should get chris to help you.
Sometimes terms such as generic and vendor neutral can be confusing.
Especially when chris is saying you will get a warning not an error WHEN
YOU USE BOTH.
I know you think he is being helpful,

but actually he has got his nickers in twist because he doesn't know what
those terms mean that he is himself using either.
If he did he would say to you why are you using vendor specific API and
Vendor neutral API at same time on the same application server.
You see what tomcat is really saying  you are confused by terminology just
like chris.


www.backbutton.co.uk
♡۶¯\_(ツ)_/¯ ♡۶
Marriage of loose and tight coupling
-> healthy applications
              ♡۶
Wot no  -classpath  --class-path  even ! -cp
javac   Garden/Vegetables/VineVegetable.java
java   Garden.Vegetables.VineVegetable


On Fri, 3 Jan 2020 at 23:50, zahid <za...@gmail.com> wrote:

> chris,
>
>
> Is commons-dbcp-2.x   a Database pooling component for any container
> Jetty,Jboss tomcat   etc. ?
>
> is commons-dbcp-2.x a third option, separate option from the two pooling
> options [tomcat-pool and commons-pool] you mentioned ?
>
>
> 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:
> >
> >> -----BEGIN PGP SIGNED MESSAGE-----
> >> Hash: SHA256
> >>
> >> 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
> >> -----BEGIN PGP SIGNATURE-----
> >> Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/
> >>
> >> iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAl4PwFkACgkQHPApP6U8
> >> pFiEZRAAloB5RkBB0HrUvYfHd2DJbR5h2xt2WxaKbK6Rql/cdjVEC1dftrGSL9a7
> >> EvFkFl8juTA0oD/9mjGHKtN1MLgV+EFEu5hTppR+3wnkX/8djwp8L27AmtQ/xcT8
> >> /5vasZfn8Web/WqJIJGVF9BiEHoUCr4+M7G+PA8rvsskpIAZKux9NhbliDUYUwzi
> >> R7GsjNelBKixCa8Qy5Q7LqNcHN4RDygXKYsLZVoeoliEBaUOTWHeLoXAo6BQYsVW
> >> Tce5S3xePN6ZG3A5o5lT2bIjWKJp4qDu2CgPHJ0TQyAuey4rpkYmeI7uesmZhr6T
> >> XpwWnk8kYLG7ZCRR99KBF0lx67PQmtxZLoN4kDYQ77x7XUW5c/Qsv2PcOcvXmbzk
> >> iau8YsitqivEAtRh68XG4wrK37vGfkGNzTaSPzpZqgCIiJCotIV6mwQMjo97Ium/
> >> lxSTjLhLEkLNDegHk43wiW02AYfn+2FA0QBTiNX5OoWKu2YD/wrWnmljDwQKO6qL
> >> /ycYDnUCjkcmi0NZJil1kJtB2p8EKwy67W7PPRg2sf2VadFgifJlxO326UW1qK+e
> >> Gv8RjXgEHVOt2ydTa6sTFXT1fjcHaojVx5XgEK19UKNIUcMkyOUh6cZ5N/8d9UMn
> >> +jdZIx4hmxYshdoa4TO2JD6H8I087P8VNCL78RbeWTERUBBvvnc=
> >> =jSNi
> >> -----END PGP SIGNATURE-----
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> >> For additional commands, e-mail: users-help@tomcat.apache.org
> >>
> >>
> --
> www.backbutton.co.uk
>        ¯\_(ツ)_/¯
> ♡۶ Lynx text browser
> recover crashed ms-word .doc with ms-debug.
>
>

Re: JDBC connection pooling maxActive or MaxTotal

Posted by zahid <za...@gmail.com>.
chris,


Is commons-dbcp-2.x   a Database pooling component for any container 
Jetty,Jboss tomcat   etc. ?

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


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:
>
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA256
>>
>> 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
>> -----BEGIN PGP SIGNATURE-----
>> Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/
>>
>> iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAl4PwFkACgkQHPApP6U8
>> pFiEZRAAloB5RkBB0HrUvYfHd2DJbR5h2xt2WxaKbK6Rql/cdjVEC1dftrGSL9a7
>> EvFkFl8juTA0oD/9mjGHKtN1MLgV+EFEu5hTppR+3wnkX/8djwp8L27AmtQ/xcT8
>> /5vasZfn8Web/WqJIJGVF9BiEHoUCr4+M7G+PA8rvsskpIAZKux9NhbliDUYUwzi
>> R7GsjNelBKixCa8Qy5Q7LqNcHN4RDygXKYsLZVoeoliEBaUOTWHeLoXAo6BQYsVW
>> Tce5S3xePN6ZG3A5o5lT2bIjWKJp4qDu2CgPHJ0TQyAuey4rpkYmeI7uesmZhr6T
>> XpwWnk8kYLG7ZCRR99KBF0lx67PQmtxZLoN4kDYQ77x7XUW5c/Qsv2PcOcvXmbzk
>> iau8YsitqivEAtRh68XG4wrK37vGfkGNzTaSPzpZqgCIiJCotIV6mwQMjo97Ium/
>> lxSTjLhLEkLNDegHk43wiW02AYfn+2FA0QBTiNX5OoWKu2YD/wrWnmljDwQKO6qL
>> /ycYDnUCjkcmi0NZJil1kJtB2p8EKwy67W7PPRg2sf2VadFgifJlxO326UW1qK+e
>> Gv8RjXgEHVOt2ydTa6sTFXT1fjcHaojVx5XgEK19UKNIUcMkyOUh6cZ5N/8d9UMn
>> +jdZIx4hmxYshdoa4TO2JD6H8I087P8VNCL78RbeWTERUBBvvnc=
>> =jSNi
>> -----END PGP SIGNATURE-----
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
-- 
www.backbutton.co.uk
       ¯\_(ツ)_/¯
♡۶ Lynx text browser
recover crashed ms-word .doc with ms-debug.


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


Re: JDBC connection pooling maxActive or MaxTotal

Posted by Dave Bothwell <db...@primepoint.com>.
Chris,

That was very helpful.

Thank you
Dave



On Fri, Jan 3, 2020 at 5:29 PM Christopher Schultz <
chris@christopherschultz.net> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
>
> 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
> -----BEGIN PGP SIGNATURE-----
> Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/
>
> iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAl4PwFkACgkQHPApP6U8
> pFiEZRAAloB5RkBB0HrUvYfHd2DJbR5h2xt2WxaKbK6Rql/cdjVEC1dftrGSL9a7
> EvFkFl8juTA0oD/9mjGHKtN1MLgV+EFEu5hTppR+3wnkX/8djwp8L27AmtQ/xcT8
> /5vasZfn8Web/WqJIJGVF9BiEHoUCr4+M7G+PA8rvsskpIAZKux9NhbliDUYUwzi
> R7GsjNelBKixCa8Qy5Q7LqNcHN4RDygXKYsLZVoeoliEBaUOTWHeLoXAo6BQYsVW
> Tce5S3xePN6ZG3A5o5lT2bIjWKJp4qDu2CgPHJ0TQyAuey4rpkYmeI7uesmZhr6T
> XpwWnk8kYLG7ZCRR99KBF0lx67PQmtxZLoN4kDYQ77x7XUW5c/Qsv2PcOcvXmbzk
> iau8YsitqivEAtRh68XG4wrK37vGfkGNzTaSPzpZqgCIiJCotIV6mwQMjo97Ium/
> lxSTjLhLEkLNDegHk43wiW02AYfn+2FA0QBTiNX5OoWKu2YD/wrWnmljDwQKO6qL
> /ycYDnUCjkcmi0NZJil1kJtB2p8EKwy67W7PPRg2sf2VadFgifJlxO326UW1qK+e
> Gv8RjXgEHVOt2ydTa6sTFXT1fjcHaojVx5XgEK19UKNIUcMkyOUh6cZ5N/8d9UMn
> +jdZIx4hmxYshdoa4TO2JD6H8I087P8VNCL78RbeWTERUBBvvnc=
> =jSNi
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

-- 

<https://www.primepoint.com/>

David Bothwell

Chairman of the Board, Chief technology Officer | Primepoint, LLC

Address: 2 Springside Road, Westampton, NJ 08060

Phone: 800-600-5257

<https://www.primepoint.com/>-
<https://www.facebook.com/Primepoint.Payroll.HR/>-
<https://www.instagram.com/primepointllc/>-
<https://www.linkedin.com/company/505608?trk=tyah&trkInfo=clickedVertical%3Acompany%2CclickedEntityId%3A505608%2Cidx%3A2-2-3%2CtarId%3A1447790586761%2Ctas%3Aprimepoint>
- <https://twitter.com/primepoint>- <https://vimeo.com/user55649759>

-- 
This communication, and any information or attachments contained within, 
may contain privileged or confidential information that is intended for the 
sole use of the recipient or recipients named above. If the reader of this 
message is not an intended recipient, or authorized to receive such 
messages for an intended recipient, you are hereby notified that any 
review, use, dissemination, copying, or distribution of this communication, 
or any of its contents is strictly prohibited. If you have received this 
message in error, please notify us immediately of the error by return email 
and permanently remove the original message, its contents, and any copies 
from your system. Thank you.

Re: JDBC connection pooling maxActive or MaxTotal

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

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
-----BEGIN PGP SIGNATURE-----
Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/

iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAl4PwFkACgkQHPApP6U8
pFiEZRAAloB5RkBB0HrUvYfHd2DJbR5h2xt2WxaKbK6Rql/cdjVEC1dftrGSL9a7
EvFkFl8juTA0oD/9mjGHKtN1MLgV+EFEu5hTppR+3wnkX/8djwp8L27AmtQ/xcT8
/5vasZfn8Web/WqJIJGVF9BiEHoUCr4+M7G+PA8rvsskpIAZKux9NhbliDUYUwzi
R7GsjNelBKixCa8Qy5Q7LqNcHN4RDygXKYsLZVoeoliEBaUOTWHeLoXAo6BQYsVW
Tce5S3xePN6ZG3A5o5lT2bIjWKJp4qDu2CgPHJ0TQyAuey4rpkYmeI7uesmZhr6T
XpwWnk8kYLG7ZCRR99KBF0lx67PQmtxZLoN4kDYQ77x7XUW5c/Qsv2PcOcvXmbzk
iau8YsitqivEAtRh68XG4wrK37vGfkGNzTaSPzpZqgCIiJCotIV6mwQMjo97Ium/
lxSTjLhLEkLNDegHk43wiW02AYfn+2FA0QBTiNX5OoWKu2YD/wrWnmljDwQKO6qL
/ycYDnUCjkcmi0NZJil1kJtB2p8EKwy67W7PPRg2sf2VadFgifJlxO326UW1qK+e
Gv8RjXgEHVOt2ydTa6sTFXT1fjcHaojVx5XgEK19UKNIUcMkyOUh6cZ5N/8d9UMn
+jdZIx4hmxYshdoa4TO2JD6H8I087P8VNCL78RbeWTERUBBvvnc=
=jSNi
-----END PGP SIGNATURE-----

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


Re: JDBC connection pooling maxActive or MaxTotal

Posted by zahid <za...@gmail.com>.
|I hope these descriptions of the setting helps you in making a decision 
as to the value. <!-- maxTotal: Maximum number of database connections 
in pool. Make sure you configure your mysqld max_connections large 
enough to handle all of your db connections. Set to -1 for no limit. --> 
<!-- maxIdle: Maximum number of idle database connections to retain in 
pool. Set to -1 for no limit. See also the DBCP 2 documentation on this 
and the minEvictableIdleTimeMillis configuration parameter. -->|

|maxActive| (int) The maximum number of active connections that can be 
allocated from this pool at the same time. The default value is |100|||

|
|

On 03/01/2020 18:47, Dave Bothwell wrote:
> Hello,
>
> 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.
>
> 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.
>
> my question is which attribute should I be using?
>
> Thanks
> Dave
>
-- 
www.backbutton.co.uk
       ¯\_(ツ)_/¯
♡۶ Lynx text browser
recover crashed ms-word .doc with ms-debug.