{"record":{"id":"6ebe2b0aaaeb7774","repo":"apache/shardingsphere","slug":"rowdeleted-6ebe2b","errorCode":null,"errorMessage":"rowDeleted","messagePattern":"rowDeleted","errorType":"exception","errorClass":"SQLFeatureNotSupportedException","httpStatus":null,"severity":"error","filePath":"kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/resultset/AbstractUnsupportedOperationSQLFederationResultSet.java","lineNumber":140,"sourceCode":"    \n    @Override\n    public final void moveToCurrentRow() throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"moveToCurrentRow\");\n    }\n    \n    @Override\n    public final boolean rowInserted() throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"rowInserted\");\n    }\n    \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","sourceCodeStart":122,"sourceCodeEnd":158,"githubUrl":"https://github.com/apache/shardingsphere/blob/e952770a215630a3659c75d64369168cd3e26b82/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/resultset/AbstractUnsupportedOperationSQLFederationResultSet.java#L122-L158","documentation":"rowDeleted() throws SQLFeatureNotSupportedException in the SQL Federation ResultSet. JDBC delete-visibility detection requires an updatable cursor implementation; the federation ResultSet is read-only and final, so it rejects all calls to rowDeleted() regardless of data or state.","triggerScenarios":"Calling rs.rowDeleted() in a row loop over a federated ResultSet, e.g. skipping logically deleted rows via if (rs.rowDeleted()) continue;, often alongside rowInserted()/rowUpdated() visibility checks.","commonSituations":"ETL/replication jobs distinguishing soft deletes; GUIs collapsing rows deleted by other sessions; code originally validated on a single-node driver (PostgreSQL updatable cursors raise errors, MySQL supports visibility flags) and then moved behind federation without auditing these calls.","solutions":["Use logical-delete flags (deleted=1 / deleted_at) in the schema and filter with WHERE conditions instead of rowDeleted()","Maintain a delete ledger in application state when your own code deletes rows and the loop must skip them","Remove visibility-method usage from shared row-iteration helpers before enabling SQL Federation"],"exampleFix":"// before\nwhile (rs.next()) { if (rs.rowDeleted()) continue; process(rs); }\n\n// after\nResultSet rs = stmt.executeQuery(\"SELECT ... FROM t WHERE deleted = 0\");\nwhile (rs.next()) { process(rs); }","handlingStrategy":"try-catch","validationCode":"try { rs.rowDeleted(); /* supported */ }\ncatch (final SQLFeatureNotSupportedException e) { /* visibility unsupported: use logical-delete flags */ }","typeGuard":"private boolean isFederationVisibilitySupported(final ResultSet rs) {\n    return rs.getClass().getName().startsWith(\"org.apache.shardingsphere.sqlfederation\") == false;\n}","tryCatchPattern":"boolean deleted;\ntry { deleted = rs.rowDeleted(); }\ncatch (final SQLFeatureNotSupportedException e) { deleted = rs.getBoolean(\"deleted_flag\"); }","preventionTips":["Model deletes as logical-delete columns","Maintain an application-side delete ledger","Filter with WHERE deleted = 0 instead of visibility checks"],"tags":["jdbc","resultset","sql-federation","visibility","delete","shardingsphere"],"backgroundTag":null,"analyzedSha":"e952770a215630a3659c75d64369168cd3e26b82","analyzedAt":"2026-08-14T13:54:53.392Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}