users@glassfish.java.net

Re: Re: Strange database closed exception

From: John Lister <john.lister_at_kickstone.com>
Date: Thu, 16 Aug 2012 12:07:55 +0100

On 16/08/2012 07:35, Mitesh Meswani wrote:
> The connections might have timed out by database due to inactivity.
> Turn on connection validation
> <https://blogs.oracle.com/JagadishPrasath/entry/connection_validation_in_glassfish_jdbc>
> for your pool to check for stale connections.
>
Thanks for your reply. Connection validation is turned on (using a
table) although I noticed that with a custom resource adapter I wrote
which was also configured to validate the connection before use,
validation stopped after a while until glassfish was restarted which I
couldn't figure out - not sure if the same is happening here?

The text of the error gives the impression that the connection pool has
closed the connection rather than the underlying database connection
having a problem (or been closed) - but that isn't necessarily true. The
other oddity is that this isn't the first query to be made with what I'm
guessing is the same db connection/transaction. This happens as part of
a series of functions called by an EJB method using the same entity
manager so I'd expect them to be with the same underlying connection?

I'm resisting turning on more logging as this is on a production server
which would generate huge log files, but if nothing else pops up...

John