Application should not crash if you fail to get database connection from pool. 
Instead it should wait until the configured timeout is reached, and then it 
will throw exception, which is SQLException if I recall correctly.
At that point you code will catch the exception and log it, but it will not 
crash.

https://tomcat.apache.org/tomcat-9.0-doc/jdbc-pool.html#Common_Attributes

* maxWait
* (int) The maximum number of milliseconds that the pool will wait (when there 
are no available connections) for a connection to be returned before throwing 
an exception. Default value is 30000 (30 seconds)

But I can't find similar setting from Glassfish (Payara):
https://docs.payara.fish/community/docs/5.193/documentation/payara-server/advanced-jdbc/advanced-connection-pool-properties.html

So I assume that Glassfish will throw exception immediately when it runs out of 
connections.

-Harri

-----Original Message-----
From: Rob Sargent <rsarg...@xmission.com> 
Sent: tiistai 12. elokuuta 2025 4.51
To: Tomcat Users List <users@tomcat.apache.org>
Cc: Tomcat Users List <users@tomcat.apache.org>
Subject: Re: [EXTERNAL EMAIL] RE: How to access a REST service


I'm interested in what you mean by "crashes". To me, that usually means that 
the process stops at the very least. Do you mean that the request fails, or 
something much worse?
> 
> DGS: By "crashes" I mean that the program terminates, usually just after 
> printing out a stack trace.
> 


I am sure I am not the only one who would like to see that stack trace

 

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


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

Reply via email to