{"record":{"id":"d9e0a96ebec1f789","repo":"apache/shardingsphere","slug":"cancelrowupdates","errorCode":null,"errorMessage":"cancelRowUpdates","messagePattern":"cancelRowUpdates","errorType":"exception","errorClass":"SQLFeatureNotSupportedException","httpStatus":null,"severity":"error","filePath":"jdbc/src/main/java/org/apache/shardingsphere/driver/jdbc/unsupported/AbstractUnsupportedOperationResultSet.java","lineNumber":115,"sourceCode":"    \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\n    public final void moveToInsertRow() throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"moveToInsertRow\");\n    }\n    \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","sourceCodeStart":97,"sourceCodeEnd":133,"githubUrl":"https://github.com/apache/shardingsphere/blob/e952770a215630a3659c75d64369168cd3e26b82/jdbc/src/main/java/org/apache/shardingsphere/driver/jdbc/unsupported/AbstractUnsupportedOperationResultSet.java#L97-L133","documentation":"cancelRowUpdates() is a final method in AbstractUnsupportedOperationResultSet that unconditionally throws SQLFeatureNotSupportedException. Cancelling pending row edits presumes an updatable cursor, which the sharding ResultSet does not provide, and updateXxx methods on it are likewise unsupported.","triggerScenarios":"Calling ResultSet.cancelRowUpdates() on a sharding ResultSet, typically from editable-table UIs or generic JDBC wrappers that roll back in-memory row edits before updateRow.","commonSituations":"Data-grid components (Swing JTable bindings, SWT/JFace, Apache Pivot) that manage dirty-row state via cancelRowUpdates; application code moved to the sharding JDBC URL without auditing cursor-edit calls.","solutions":["Manage edit/rollback state in the application layer (edit a detached copy of the row; only issue SQL when the user confirms).","Request read-only concurrency so UI components do not attempt cursor edits.","If cursor editing is mandatory, perform it on a connection from the underlying physical datasource."],"exampleFix":"// before\nif (rowDirty) { rs.cancelRowUpdates(); } // throws\n\n// after\n// keep a local editable copy of row data; discard it to 'cancel'\neditableRow = null; // nothing was ever sent to the DB","handlingStrategy":"try-catch","validationCode":"if (rs.getConcurrency() == ResultSet.CONCUR_READ_ONLY) {\n    // pending edits live only in your app state; discard them there\n}","typeGuard":null,"tryCatchPattern":"try {\n    rs.cancelRowUpdates();\n} catch (SQLFeatureNotSupportedException e) {\n    discardLocalEdits(); // application-level rollback of the edit buffer\n}","preventionTips":["Keep row-edit state in a local buffer; never stage edits on the ResultSet.","Bind UI grids in read-only mode against sharded datasources.","Design cancel as discarding a detached copy, not a cursor call."],"tags":["jdbc","resultset","row-updates","shardingsphere","unsupported-operation"],"backgroundTag":null,"analyzedSha":"e952770a215630a3659c75d64369168cd3e26b82","analyzedAt":"2026-08-14T13:54:53.392Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}