> On 2025 Aug 16, at 12:21, Daniel Schwartz <d...@danielgschwartz.com> wrote:
> 
> I just sent a code fragment where I retrieve a list of countries from the DB, 
> so won't repeat this here.  However, I did find that I was mistaken in saying 
> that Glassfish won't accept a minimum pool size less than 8.  I don't know 
> what happened before, but today I was able to set both the minimum and 
> maximum to 1.


Good.


> 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).


> I have no idea what all this means, but I think that the message copied below 
> was generated each time some web crawler was submitting a query.  These come 
> quite frequently.
> 
> By the way, I don't know how they do this, but the web crawlers somehow 
> figured out that I submit queries to the web service using Get requests, with 
> parameters for "country", "state", "city", "year", and are creating bogus 
> queries by randomly filling these in, usually with values that don't make any 
> sense, like "country=England", "state=England", "city=Scotland", and 
> "year=2087".  These queries won't return any results, but they do initiate a 
> DB connection.  These are happening many times every day.


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.


> -------------------------------------------------------------------------------
> 
> [2025-08-16T16:54:23.735+0000] [glassfish 4.1] [WARNING] 
> [poolmgr.get_connection_failure] 
> [javax.enterprise.resource.resourceadapter.com.sun.enterprise.connectors] 
> [tid: _ThreadID=30 _ThreadName=http-listener-1(4)] [timeMillis: 
> 1755363263735] [levelValue: 900] [[
>  RAR5117 : Failed to obtain/create connection from connection pool [ 
> HolidaysConnectionPool ]. Reason : 
> com.sun.appserv.connectors.internal.api.PoolingException: In-use connections 
> equal max-pool-size and expired max-wait-time. Cannot allocate more 
> connections.]]
> 
> [2025-08-16T16:54:23.735+0000] [glassfish 4.1] [WARNING] [jdbc.exc_get_conn] 
> [javax.enterprise.resource.resourceadapter.com.sun.gjc.spi] [tid: 
> _ThreadID=30 _ThreadName=http-listener-1(4)] [timeMillis: 1755363263735] 
> [levelValue: 900] [[
>  RAR5114 : Error allocating connection : [Error in allocating a connection. 
> Cause: In-use connections equal max-pool-size and expired max-wait-time. 
> Cannot allocate more connections.]]]
> 
> [2025-08-16T16:54:23.735+0000] [glassfish 4.1] [INFO] [] [] [tid: 
> _ThreadID=30 _ThreadName=Thread-8] [timeMillis: 1755363263735] [levelValue: 
> 800] [[
>  [Ljava.lang.StackTraceElement;@2545fa37]]


  - Chuck


Reply via email to