{"record":{"id":"c05f3d34eba4372b","repo":"apache/shardingsphere","slug":"refreshrow","errorCode":null,"errorMessage":"refreshRow","messagePattern":"refreshRow","errorType":"exception","errorClass":"SQLFeatureNotSupportedException","httpStatus":null,"severity":"error","filePath":"jdbc/src/main/java/org/apache/shardingsphere/driver/jdbc/unsupported/AbstractUnsupportedOperationResultSet.java","lineNumber":110,"sourceCode":"    \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\n    public final void moveToCurrentRow() throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"moveToCurrentRow\");\n    }\n    \n    @Override","sourceCodeStart":92,"sourceCodeEnd":128,"githubUrl":"https://github.com/apache/shardingsphere/blob/e952770a215630a3659c75d64369168cd3e26b82/jdbc/src/main/java/org/apache/shardingsphere/driver/jdbc/unsupported/AbstractUnsupportedOperationResultSet.java#L92-L128","documentation":"refreshRow() is marked final in AbstractUnsupportedOperationResultSet and always throws SQLFeatureNotSupportedException. Re-fetching the current row from the database is meaningless in the sharding driver because the merged view has no single backing cursor row to refresh.","triggerScenarios":"Calling ResultSet.refreshRow() on a ResultSet from ShardingSphereDataSource, often after external modifications, or from ORM cache-refresh logic (e.g. Hibernate force-refresh) and Swing/SWT table bindings that call refreshRow after edits.","commonSituations":"Desktop CRUD tools or ORM refresh features assuming a live updatable cursor; code migrated from drivers (MySQL Connector/J with CONCUR_UPDATABLE, Oracle) that implement refreshRow.","solutions":["Re-execute the original query (possibly on the same key range) to obtain fresh data instead of refreshing in place.","Disable the framework feature that triggers refreshRow (e.g. disable updatable/refreshable result sets in the ORM or grid component).","Query the specific row with a keyed SELECT if only one row needs refreshing."],"exampleFix":"// before\nrs.refreshRow(); // throws\n\n// after\ntry (PreparedStatement ps = conn.prepareStatement(\"SELECT * FROM t WHERE id = ?\")) {\n    ps.setLong(1, id);\n    try (ResultSet fresh = ps.executeQuery()) { /* re-read */ }\n}","handlingStrategy":"try-catch","validationCode":"// no pre-call capability flag exists; detect the driver up front\nboolean isSharding = conn.getMetaData().getURL().startsWith(\"jdbc:shardingsphere:\");\nif (isSharding) { /* re-query instead of refreshRow */ }","typeGuard":null,"tryCatchPattern":"try {\n    rs.refreshRow();\n} catch (SQLFeatureNotSupportedException e) {\n    rs = reExecuteQuery(conn, sql, params); // rebuild the ResultSet\n}","preventionTips":["Do not rely on cursor freshness; re-run keyed SELECTs for fresh data.","Disable ORM refresh modes that call refreshRow.","Treat the ResultSet as a snapshot, not a live window."],"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"}