{"record":{"id":"b7f242b9aac9d58c","repo":"apache/shardingsphere","slug":"rowinserted","errorCode":null,"errorMessage":"rowInserted","messagePattern":"rowInserted","errorType":"exception","errorClass":"SQLFeatureNotSupportedException","httpStatus":null,"severity":"error","filePath":"jdbc/src/main/java/org/apache/shardingsphere/driver/jdbc/unsupported/AbstractUnsupportedOperationResultSet.java","lineNumber":130,"sourceCode":"    \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\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","sourceCodeStart":112,"sourceCodeEnd":148,"githubUrl":"https://github.com/apache/shardingsphere/blob/e952770a215630a3659c75d64369168cd3e26b82/jdbc/src/main/java/org/apache/shardingsphere/driver/jdbc/unsupported/AbstractUnsupportedOperationResultSet.java#L112-L148","documentation":"rowInserted() is a final method in AbstractUnsupportedOperationResultSet that always throws SQLFeatureNotSupportedException. Visible-insert detection is part of the updatable-cursor model the sharding driver does not implement, since its merged rows come from many physical ResultSets.","triggerScenarios":"Calling ResultSet.rowInserted() on a ResultSet from ShardingSphereDataSource — commonly inside change-tracking loops of editable grids or sync code that flags rows inserted through the cursor since the last fetch.","commonSituations":"Data-sync or diff tools written against updatable ResultSets; JDBC tutorial sample code reused verbatim; frameworks that detect row visibility changes after batch inserts.","solutions":["Track insertions in application state (e.g. a key set collected when you execute INSERTs) instead of asking the ResultSet.","Rewrite the check as a SQL EXISTS/primary-key query against the table.","Run the visibility checks on the physical datasource connection if truly needed."],"exampleFix":"// before\nif (rs.rowInserted()) { /* ... */ } // throws\n\n// after\nSet<Long> insertedIds = new HashSet<>(); // maintained when you run INSERTs\nif (insertedIds.contains(id)) { /* ... */ }","handlingStrategy":"try-catch","validationCode":"// capability is absent under this driver; detect driver up front\nboolean isSharding = conn.getMetaData().getURL().startsWith(\"jdbc:shardingsphere:\");","typeGuard":null,"tryCatchPattern":"try {\n    boolean inserted = rs.rowInserted();\n} catch (SQLFeatureNotSupportedException e) {\n    inserted = insertedIds.contains(id); // app-tracked set\n}","preventionTips":["Track inserts in application state (key sets) rather than asking the cursor.","Never depend on visible-insert semantics from a merged/sharded ResultSet."],"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"}