> On 2025 Aug 16, at 12:44, Daniel Schwartz <d...@danielgschwartz.com> wrote: > > From: Chuck Caldarale <n82...@gmail.com> > Sent: Saturday, August 16, 2025 1:33 PM > To: Tomcat Users List <users@tomcat.apache.org> > Subject: Re: [EXTERNAL EMAIL] How to access a REST service > >> Immediately after doing this, the message copied below started appearing >> repeatedly in the server.log and my website stopped working---the DB >> evidently became inaccessible. However, Glassfish was still running, and as >> soon as I set the maximum pool size back to 1000, these messages stopped >> coming and the website started working again. > > Indicative of an orphaned connection (resource leak). > > DGS: Why is this? What do those messages have to do with a resource leak?
When the pool is at its maximum and all connections are in use, GlassFish will hold requests for a configurable amount of time (max-wait, defaults to 60 seconds), and only abort the request and log the situation after the caller has been suspended for that amount of time. Since your web service’s response time is very quick, this indicates the only allocated connection has stayed in-use for over a minute - something leaked it. When the maximum pool size is set to your usual value, GlassFish eventually cleans things up because it periodically discards all existing connections and acquires new ones just in case they have become unusable from the DB point of view. > So this is very interesting, and points to a possible line of investigation. > If the web crawlers are throwing garbage at your app, that could possibly be > resulting in losing track of connections, statements, result sets, etc. You > should carefully check your error paths and make sure that all DB-related > resources are being properly disposed of when invalid input is received. > > DGS: I'm fairly sure that all connections and prepared statements are being > closed, but will look again. This would be happening in the code fragment > that tries to retrieve the list of holidays with calculated dates (not the > countries). This is somewhat complex and could have problems. Your GetCountryList code from a previous message doesn’t dispose of the ResultSet object; depending on the implementation details of the JDBC driver and pool, closing the result set may not be required, but it’s always good practice to do so. Since the ResultSet object contains a reference to the Connection (and vice-versa), it may be interfering with reuse of the connection until a garbage collection happens. - Chuck --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org