{"record":{"id":"459f31d71502e94a","repo":"apache/shardingsphere","slug":"getholdability","errorCode":null,"errorMessage":"getHoldability","messagePattern":"getHoldability","errorType":"exception","errorClass":"SQLFeatureNotSupportedException","httpStatus":null,"severity":"error","filePath":"jdbc/src/main/java/org/apache/shardingsphere/driver/jdbc/unsupported/AbstractUnsupportedOperationResultSet.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/jdbc/src/main/java/org/apache/shardingsphere/driver/jdbc/unsupported/AbstractUnsupportedOperationResultSet.java#L132-L168","documentation":"getHoldability() is final in AbstractUnsupportedOperationResultSet and always throws SQLFeatureNotSupportedException. The sharding ResultSet abstracts over multiple physical ResultSets from different connections, each potentially with its own holdability, so a single value cannot be reported.","triggerScenarios":"Calling ResultSet.getHoldability() on a ResultSet from ShardingSphereDataSource — usually via generic JDBC metadata crawlers, ORM bootstrap code that inspects result-set capabilities, or code deciding commit behavior for held cursors.","commonSituations":"Framework capability checks that enumerate all ResultSet methods; migration from a plain driver where getHoldability returned Connection.HOLD_CURSORS_OVER_COMMIT; tooling that assumes holdability when mixing commits with open ResultSets.","solutions":["Read holdability from the underlying objects instead: Connection.getHoldability() or Statement instance metadata, or query the physical datasource connection.","Remove the call if it was only informational probing; hard-code the behavior your flow needs (close ResultSets before commit).","Wrap the call in a try/catch for SQLFeatureNotSupportedException during generic introspection."],"exampleFix":"// before\nint hold = rs.getHoldability(); // throws\n\n// after\nint hold = conn.getHoldability(); // from the ShardingSphere Connection, or the physical connection","handlingStrategy":"try-catch","validationCode":"int holdability = conn.getHoldability(); // ask the Connection, not the ResultSet","typeGuard":null,"tryCatchPattern":"try {\n    int h = rs.getHoldability();\n} catch (SQLFeatureNotSupportedException e) {\n    h = conn.getHoldability();\n}","preventionTips":["Never rely on ResultSet-level holdability under sharding.","Close ResultSets before commit instead of depending on held cursors.","Read capability data from Connection/Statement objects."],"tags":["jdbc","resultset","metadata","shardingsphere","unsupported-operation"],"backgroundTag":null,"analyzedSha":"e952770a215630a3659c75d64369168cd3e26b82","analyzedAt":"2026-08-14T13:54:53.392Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}