Skip to content

JDBC Connection Pool validation doesn't work if "Validate At Most Once" is set to >0 #25930

@andichief

Description

@andichief

GlassFish Version (and build number)

7.1.0, 8.0.0 and also 7.0.22

JDK version

JDK 21

OS

linux/windows

Database

oracle

Problem Description

A broken JDBC Connection is not validated and stays broken forever if I set "Validate At Most Once" to a higher value than Zero

Steps to reproduce

To get a broken connection I set equest-timeout-seconds to 2 seconds
asadmin> set configs.config.server-config.network-config.protocols.protocol.http-listener-1.http.request-timeout-seconds=2

than I lock the record I want to write via my application in the database
select * from myrecord for update

than I do the http request to write this record the request is interrupted
java.sql.SQLRecoverableException: ORA-18730: Interrupted IO error.: Socket read interrupted
https://docs.oracle.com/error-help/db/ora-18730/
at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:1494)

I see Closed Connection exception in the server.log but the connection is not repaired and seems to be validated agaign

[2026-02-16T08:33:17.758874+01:00] [GF 7.1.0] [SEVERE] [poolmgr.system_exception] [jakarta.enterprise.resource.resourceadapter.com.sun.enterprise.resource] [tid: _ThreadID=486 _ThreadName=casino-listener(2)] [levelValue: 1000] [[
RAR5031:System Exception
jakarta.resource.spi.LocalTransactionException: ORA-17008: Closed connection
https://docs.oracle.com/error-help/db/ora-17008/

when I set Validate At Most Once to Zero I see that the connection is validated and the Closed Connection Exception is gone

[2026-02-16T08:33:18.858686+01:00] [GF 7.1.0] [INFO] [jdbc.exc_table_validation] [jakarta.enterprise.resource.resourceadapter.com.sun.gjc.spi] [tid: _ThreadID=233 _ThreadName=__ejb-thread-pool4] [levelValue: 800] [[
RAR5074 : Table based validation detected invalid connection. Querying the table dual failed. Set resource-adapter log-level to FINE for exception stack trace.]]

Impact of Issue

JDB Connections are forever broken

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions