{"record":{"id":"4549d4fdd5f27532","repo":"apache/shardingsphere","slug":"updaterow-4549d4","errorCode":null,"errorMessage":"updateRow","messagePattern":"updateRow","errorType":"exception","errorClass":"SQLFeatureNotSupportedException","httpStatus":null,"severity":"error","filePath":"kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/resultset/AbstractUnsupportedOperationSQLFederationResultSet.java","lineNumber":100,"sourceCode":"    \n    @Override\n    public boolean relative(final int rows) throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"relative\");\n    }\n    \n    @Override\n    public int getRow() throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"getRow\");\n    }\n    \n    @Override\n    public final void insertRow() throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"insertRow\");\n    }\n    \n    @Override\n    public final void updateRow() throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"updateRow\");\n    }\n    \n    @Override\n    public final void deleteRow() throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"deleteRow\");\n    }\n    \n    @Override\n    public final void refreshRow() throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"refreshRow\");\n    }\n    \n    @Override\n    public final void cancelRowUpdates() throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"cancelRowUpdates\");\n    }\n    \n    @Override","sourceCodeStart":82,"sourceCodeEnd":118,"githubUrl":"https://github.com/apache/shardingsphere/blob/e952770a215630a3659c75d64369168cd3e26b82/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/resultset/AbstractUnsupportedOperationSQLFederationResultSet.java#L82-L118","documentation":"updateRow() is not supported: the federation ResultSet is a read-only view of federation engine output, and AbstractUnsupportedOperationSQLFederationResultSet marks updateRow() final and throws SQLFeatureNotSupportedException for any attempt to flush row edits through the ResultSet cursor API.","triggerScenarios":"Calling rs.updateRow() after updateXXX() calls on a federated ResultSet — the final step of the JDBC updatable-result-set edit pattern — against a ShardingSphere federation statement.","commonSituations":"Grid/table UI editors that commit cell edits via updateRow(); applications written for updatable cursors on a single-node database later pointed at ShardingSphere with federation enabled; accidental UPDATE-via-ResultSet on a query that federation rewrote (e.g. a cross-shard SELECT with computed columns).","solutions":["Replace ResultSet-based edits with explicit UPDATE ... WHERE key = ? PreparedStatements on the same connection","Disable updatable-result-set editing in the client tool/ORM for federation datasources","Confirm the affected SELECT actually needs federation; if not, exclude it so it returns a driver-managed updatable ResultSet from the real database"],"exampleFix":"// before\nrs.updateString(\"name\", \"new\");\nrs.updateRow();\n\n// after\ntry (PreparedStatement ps = conn.prepareStatement(\"UPDATE t SET name = ? WHERE id = ?\")) {\n    ps.setString(1, \"new\");\n ps.setLong(2, id);\n    ps.executeUpdate();\n}","handlingStrategy":"try-catch","validationCode":"if (rs.getConcurrency() == ResultSet.CONCUR_READ_ONLY) {\n    // updateRow() unsupported: issue keyed UPDATE statements\n}","typeGuard":"private boolean isUpdatable(final ResultSet rs) throws SQLException {\n    return rs.getConcurrency() == ResultSet.CONCUR_UPDATABLE;\n}","tryCatchPattern":"try {\n    rs.updateRow();\n} catch (final SQLFeatureNotSupportedException e) {\n    executeKeyedUpdate(conn, tableName, changes, id);\n}","preventionTips":["Convert cursor edits to keyed UPDATE statements","Disable inline editing in DB tools for federation connections","Check rs.getConcurrency() before any updateXXX/updateRow flow"],"tags":["jdbc","resultset","sql-federation","updatable-cursor","update","shardingsphere"],"backgroundTag":null,"analyzedSha":"e952770a215630a3659c75d64369168cd3e26b82","analyzedAt":"2026-08-14T13:54:53.392Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}