{"record":{"id":"82c1a33628a9c0e1","repo":"apache/shardingsphere","slug":"getholdability-82c1a3","errorCode":null,"errorMessage":"getHoldability","messagePattern":"getHoldability","errorType":"exception","errorClass":"SQLFeatureNotSupportedException","httpStatus":null,"severity":"error","filePath":"kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/resultset/AbstractUnsupportedOperationSQLFederationResultSet.java","lineNumber":150,"sourceCode":"    \n    @Override\n    public final boolean rowUpdated() throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"rowUpdated\");\n    }\n    \n    @Override\n    public final boolean rowDeleted() throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"rowDeleted\");\n    }\n    \n    @Override\n    public final String getCursorName() throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"getCursorName\");\n    }\n    \n    @Override\n    public final int getHoldability() throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"getHoldability\");\n    }\n    \n    @Override\n    public final NClob getNClob(final int columnIndex) throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"getNClob\");\n    }\n    \n    @Override\n    public final NClob getNClob(final String columnLabel) throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"getNClob\");\n    }\n    \n    @Override\n    public final Reader getNCharacterStream(final int columnIndex) throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"getNCharacterStream\");\n    }\n    \n    @Override","sourceCodeStart":132,"sourceCodeEnd":168,"githubUrl":"https://github.com/apache/shardingsphere/blob/e952770a215630a3659c75d64369168cd3e26b82/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/resultset/AbstractUnsupportedOperationSQLFederationResultSet.java#L132-L168","documentation":"getHoldability() throws SQLFeatureNotSupportedException in the SQL Federation ResultSet. ResultSet holdability (HOLD_CURSORS_OVER_COMMIT vs CLOSE_CURSORS_OVER_COMMIT) governs cursor survival across commits; the federation result is a materialized stream with no transaction-cursor binding, so the attribute is not implemented and the final method always throws.","triggerScenarios":"Calling rs.getHoldability() on a federated ResultSet — commonly inside generic JDBC inspection utilities, monitoring wrappers, or frameworks that print full ResultSet capability reports for every result set they process.","commonSituations":"Connection-pool monitoring or SQL-logging wrappers (p6spy-style) that probe holdability per ResultSet; test harnesses asserting JDBC capability matrices; the error appears only for federation-classified statements, so it can surface intermittently after enabling sql-federation, making it look data-dependent.","solutions":["Query holdability at Connection/DatabaseMetaData level (conn.getHoldability(), dbmd.getResultSetHoldability()) instead of per-ResultSet","Make inspection wrappers defensive: wrap getHoldability() in try/catch (SQLFeatureNotSupportedException) and report 'unsupported'","Exclude such probing utilities from federation datasources or short-circuit them by product name"],"exampleFix":"// before\nreport(\"holdability\", rs.getHoldability());\n\n// after\ntry {\n    report(\"holdability\", rs.getHoldability());\n} catch (final SQLFeatureNotSupportedException ignore) {\n    report(\"holdability\", \"unsupported\");\n}","handlingStrategy":"try-catch","validationCode":"int holdability;\ntry { holdability = rs.getHoldability(); }\ncatch (final SQLFeatureNotSupportedException e) { holdability = conn.getHoldability(); /* query at connection level */ }","typeGuard":"private int safeHoldability(final ResultSet rs, final Connection conn) throws SQLException {\n    try { return rs.getHoldability(); }\n    catch (final SQLFeatureNotSupportedException e) { return conn.getHoldability(); }\n}","tryCatchPattern":"try {\n    report(\"holdability\", rs.getHoldability());\n} catch (final SQLFeatureNotSupportedException e) {\n    report(\"holdability\", conn.getHoldability());\n}","preventionTips":["Read holdability from Connection/DatabaseMetaData, not per ResultSet","Make monitoring wrappers capability-tolerant","Set expectations for holdability once at pool setup"],"tags":["jdbc","resultset","sql-federation","holdability","shardingsphere"],"backgroundTag":null,"analyzedSha":"e952770a215630a3659c75d64369168cd3e26b82","analyzedAt":"2026-08-14T13:54:53.392Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}