{"record":{"id":"cd800009cfcec69a","repo":"apache/shardingsphere","slug":"deleterow","errorCode":null,"errorMessage":"deleteRow","messagePattern":"deleteRow","errorType":"exception","errorClass":"SQLFeatureNotSupportedException","httpStatus":null,"severity":"error","filePath":"jdbc/src/main/java/org/apache/shardingsphere/driver/jdbc/unsupported/AbstractUnsupportedOperationResultSet.java","lineNumber":105,"sourceCode":"    \n    @Override\n    public final 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\n    public final void moveToInsertRow() throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"moveToInsertRow\");\n    }\n    \n    @Override","sourceCodeStart":87,"sourceCodeEnd":123,"githubUrl":"https://github.com/apache/shardingsphere/blob/e952770a215630a3659c75d64369168cd3e26b82/jdbc/src/main/java/org/apache/shardingsphere/driver/jdbc/unsupported/AbstractUnsupportedOperationResultSet.java#L87-L123","documentation":"AbstractUnsupportedOperationResultSet declares deleteRow() final and throws SQLFeatureNotSupportedException, so the sharding ResultSet never supports positioned deletes. A row in the merged result may originate from any shard, and the driver cannot reliably resolve which physical cursor row to delete.","triggerScenarios":"Calling ResultSet.deleteRow() on a ResultSet produced by ShardingSphereDataSource — directly, or via generic data-editing tools/ORMs that delete through the current cursor row instead of SQL.","commonSituations":"GUI SQL clients or admin tools wired to the sharding URL that edit rows via positioned deletes; legacy DAO code using positioned deletes; migration from a single-DB driver that supported CONCUR_UPDATABLE.","solutions":["Issue an explicit DELETE statement with a WHERE key predicate via PreparedStatement and let ShardingSphere route it.","Force read-only concurrency (Statement创建时 CONCUR_READ_ONLY) so frameworks never attempt positioned deletes.","Fall back to the physical datasource connection when positioned deletes are truly required."],"exampleFix":"// before\nrs.absolute(3);\nrs.deleteRow(); // throws\n\n// after\ntry (PreparedStatement ps = conn.prepareStatement(\"DELETE FROM t WHERE id = ?\")) {\n    ps.setLong(1, id);\n    ps.executeUpdate();\n}","handlingStrategy":"try-catch","validationCode":"if (rs.getConcurrency() == ResultSet.CONCUR_READ_ONLY) {\n    // use SQL DELETE instead of rs.deleteRow()\n}","typeGuard":"boolean supportsPositionedDelete(ResultSet rs) throws SQLException {\n    return rs.getConcurrency() != ResultSet.CONCUR_READ_ONLY;\n}","tryCatchPattern":"try {\n    rs.deleteRow();\n} catch (SQLFeatureNotSupportedException e) {\n    executeKeyedDelete(id);\n}","preventionTips":["Express deletes as DELETE ... WHERE pk = ? statements.","Disable row-editing modes in GUI/ORM components bound to the sharding datasource.","Keep a checklist of unsupported positioned operations when onboarding the sharding driver."],"tags":["jdbc","resultset","row-updates","shardingsphere","unsupported-operation"],"backgroundTag":null,"analyzedSha":"e952770a215630a3659c75d64369168cd3e26b82","analyzedAt":"2026-08-14T13:54:53.392Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}