We stumbled into it to be honest. There should be a fairly easy way though if you're on a linux box... something like..
grep -r ".getConnection" * should get you all the classes that make a call to something like sqlConn.getConnection(), and then once you have that you can check for finally {} blocks and ensure you;re closing out ________________________________________________ Kevin Huntly Email: kmhun...@gmail.com Cell: 716/424-3311 ________________________________________________ -----BEGIN GEEK CODE BLOCK----- Version: 1.0 GCS/IT d+ s a C++ UL+++$ P+(++) L+++ E--- W+++ N+ o K(+) w--- O- M-- V-- PS+ PE Y(+) PGP++(+++) t+ 5-- X-- R+ tv+ b++ DI++ D++ G++ e(+) h--- r+++ y+++* ------END GEEK CODE BLOCK------ On Mon, Apr 17, 2023 at 7:32 PM Torsten Krah <krah...@gmail.com> wrote: > Use logAbandoned as a boolean parameter, you will get stacktraces in the > log. From those you can narrow down where you are leaking connections. > > Akshay Mishra <akshay.mis...@nutanix.com> schrieb am Di., 18. Apr. 2023, > 01:07: > > > Hello Tomcat Community! > > > > > > Tomcat Version: 9.0.70 > > > > Our Tomcat web service started exhausting the max connections allowed to > > the backend datastore (Postgres). > > > > From the logs, we don’t see any 1 thread requesting lot of connections. > > Nor do we see too many threads requesting a new connection. > > We collected thread dumps (at a fixed interval of 5 mins) and they do not > > point to too many threads requesting connections. > > > > We suspect someone could be leaking connections but we are unclear on how > > to narrow that down especially since the thread dump was inconclusive > > > > We added parameters like “removeAbandoned”, “removeAbandonedTimeout” and > > “ResetAbandonedTimer” to our datasource config and the results were > > encouraging - we don't see the pool getting exhausted but are concerned > > this might mask a larger problem in case there are connection leaks in > our > > service. > > > > It would be great if the community has any thoughts on these new > > parameters. Or on way to narrow down the problem to isolate connection > > leaks. > > > > Any help is appreciated. Thanks > > > > Akshay > > >