You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Investigate statement close behaviour after connection close #878
Some spurious test failures in the hibernate-orm tests suggests that attempts to close a statement after the connection has been closed may result in error "The connection is closed [SQLState:08006, ISC error code:337248336]"; technically that is valid, but it does suggest that a connection close doesn't always close the associated statements.
This may be some exceptional circumstance, but verify this to be sure.
When the FBManagedConnection, and by extension the FbDatabase is closed (using forceClose()) due to a fatal/broken connection error, none of the listeners close statements (neither java.sql.Statement nor FbStatement), so when the statement is then closed, it tries to write a free statement message, but receives a SQLException because the connection is closed.
A stop gap measure would be for FBStatement.close() to ignore the connection closed exception, but theoretically that would violate JDBC expectations that a SQLException is thrown "if a database access error occurs".
Either FBManagedConnection needs to ensure that FBConnection marks its statements as closed, or listeners on FbDatabase should ensure FbStatement instances (and by extension java.sql.Statement instances) are closed, or both.
Activity
mrotteveel commentedon Jan 12, 2026
When the
FBManagedConnection, and by extension theFbDatabaseis closed (usingforceClose()) due to a fatal/broken connection error, none of the listeners close statements (neitherjava.sql.StatementnorFbStatement), so when the statement is then closed, it tries to write a free statement message, but receives aSQLExceptionbecause the connection is closed.A stop gap measure would be for
FBStatement.close()to ignore the connection closed exception, but theoretically that would violate JDBC expectations that aSQLExceptionis thrown "if a database access error occurs".Either
FBManagedConnectionneeds to ensure thatFBConnectionmarks its statements as closed, or listeners onFbDatabaseshould ensureFbStatementinstances (and by extensionjava.sql.Statementinstances) are closed, or both.