{"record":{"id":"b42653e1aaf51544","repo":"apache/shardingsphere","slug":"updaterowid","errorCode":null,"errorMessage":"updateRowId","messagePattern":"updateRowId","errorType":"exception","errorClass":"SQLFeatureNotSupportedException","httpStatus":null,"severity":"error","filePath":"kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/resultset/AbstractUnsupportedUpdateOperationSQLFederationResultSet.java","lineNumber":434,"sourceCode":"    \n    @Override\n    public final void updateNClob(final String columnLabel, final Reader reader, final long length) throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"updateNClob\");\n    }\n    \n    @Override\n    public final void updateArray(final int columnIndex, final Array x) throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"updateArray\");\n    }\n    \n    @Override\n    public final void updateArray(final String columnLabel, final Array x) throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"updateArray\");\n    }\n    \n    @Override\n    public final void updateRowId(final int columnIndex, final RowId x) throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"updateRowId\");\n    }\n    \n    @Override\n    public final void updateRowId(final String columnLabel, final RowId x) throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"updateRowId\");\n    }\n    \n    @Override\n    public final void updateSQLXML(final int columnIndex, final SQLXML xmlObject) throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"updateSQLXML\");\n    }\n    \n    @Override\n    public final void updateSQLXML(final String columnLabel, final SQLXML xmlObject) throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"updateSQLXML\");\n    }\n}\n","sourceCodeStart":416,"sourceCodeEnd":452,"githubUrl":"https://github.com/apache/shardingsphere/blob/e952770a215630a3659c75d64369168cd3e26b82/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/resultset/AbstractUnsupportedUpdateOperationSQLFederationResultSet.java#L416-L452","documentation":"updateRowId(int, RowId) throws SQLFeatureNotSupportedException on federation ResultSets. RowId updates are a driver-optional JDBC feature tied to a live updatable cursor against a physical row; a federation result is a merged in-memory projection, so ShardingSphere rejects the whole family explicitly.","triggerScenarios":"Calling rs.updateRowId(columnIndex, rowId) on the ResultSet of a federated query — typically code copied from Oracle usage where ROWID-based in-place updates are idiomatic.","commonSituations":"Oracle-oriented code paths that grab rs.getRowId() and later updateRowId(); generic ORM update flush logic that handles RowId columns; migration of legacy Oracle batch tools behind ShardingSphere.","solutions":["Replace RowId cursor updates with primary-key based UPDATE statements.","Rewrite or re-route the query so it does not go through the federation engine.","Map ROWID access to the physical table's primary key in your data model behind the proxy.","Catch SQLFeatureNotSupportedException in generic flush code and fall back to keyed UPDATE."],"exampleFix":"// before\nRowId rid = rs.getRowId(1);\n// ... later on a federated rs\nrs.updateRowId(1, rid);\nrs.updateRow();\n\n// after\nlong id = rs.getLong(\"id\");\ntry (PreparedStatement ps = conn.prepareStatement(\"UPDATE t SET val = ? WHERE id = ?\")) {\n    ps.setString(1, val);\n    ps.setLong(2, id);\n    ps.executeUpdate();\n}","handlingStrategy":"try-catch","validationCode":"if (rs.getConcurrency() != ResultSet.CONCUR_UPDATABLE) { throw new IllegalStateException(\"ResultSet is not updatable; use UPDATE statement\"); }","typeGuard":null,"tryCatchPattern":"try { rs.updateRowId(1, rid); } catch (final SQLFeatureNotSupportedException ex) { /* primary-key UPDATE fallback */ }","preventionTips":["Never rely on ROWID cursor updates behind a proxy; use primary keys.","Map ROWID usage to PK columns in migrated Oracle code.","Check concurrency metadata before updater calls."],"tags":["jdbc","resultset","sql-federation","unsupported-operation","rowid","oracle"],"backgroundTag":null,"analyzedSha":"e952770a215630a3659c75d64369168cd3e26b82","analyzedAt":"2026-08-14T13:54:53.392Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}