{"record":{"id":"81ccd3b5390d7794","repo":"prestodb/presto","slug":"cancelrowupdates","errorCode":null,"errorMessage":"cancelRowUpdates","messagePattern":"cancelRowUpdates","errorType":"exception","errorClass":"SQLFeatureNotSupportedException","httpStatus":null,"severity":"error","filePath":"presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoResultSet.java","lineNumber":1068,"sourceCode":"    @Override\n    public void deleteRow()\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"deleteRow\");\n    }\n\n    @Override\n    public void refreshRow()\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"refreshRow\");\n    }\n\n    @Override\n    public void cancelRowUpdates()\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"cancelRowUpdates\");\n    }\n\n    @Override\n    public void moveToInsertRow()\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"moveToInsertRow\");\n    }\n\n    @Override\n    public void moveToCurrentRow()\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"moveToCurrentRow\");\n    }\n\n    @Override\n    public Statement getStatement()","sourceCodeStart":1050,"sourceCodeEnd":1086,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoResultSet.java#L1050-L1086","documentation":"cancelRowUpdates() discards uncommitted updateXxx() changes on the current row of an updatable result set. Since Presto result sets are read-only and updateXxx() itself is unsupported, cancelRowUpdates() always throws SQLFeatureNotSupportedException(\"cancelRowUpdates\").","triggerScenarios":"Calling cancelRowUpdates() after ResultSet.updateXxx() calls on a PrestoResultSet, typically in error-handling paths of cursor-update code.","commonSituations":"Ported OLTP CRUD code with rollback-style cursor handling; generic JDBC frameworks that call cancelRowUpdates() defensively after failed updates.","solutions":["Remove the cursor-update code path entirely; Presto requires SQL UPDATE statements","Use transaction rollback (connection.rollback()) if you need to discard SQL-level changes","Guard the call behind a getConcurrency() check so it never executes against Presto"],"exampleFix":"// before\ntry {\n    rs.updateInt(\"qty\", 5);\n    rs.updateRow();\n} catch (SQLException e) {\n    rs.cancelRowUpdates();\n}\n// after\ntry (PreparedStatement ps = conn.prepareStatement(\n        \"UPDATE orders SET qty = ? WHERE id = ?\")) {\n    ps.setInt(1, 5);\n    ps.setLong(2, id);\n    ps.executeUpdate();\n}","handlingStrategy":"try-catch","validationCode":"if (rs.getConcurrency() == ResultSet.CONCUR_READ_ONLY) {\n    // no cursor updates exist to cancel; use SQL/transactions instead\n}","typeGuard":null,"tryCatchPattern":"try {\n    rs.cancelRowUpdates();\n} catch (SQLFeatureNotSupportedException e) {\n    // discard changes via connection.rollback() if in a transaction\n}","preventionTips":["Do not build cursor-update rollback logic against Presto","Use explicit transactions and rollback() for change management","Keep Presto access read-only and perform writes through SQL"],"tags":["jdbc","presto","unsupported-feature","sqlfeaturenotsupported"],"backgroundTag":"unsupported-jdbc-feature","analyzedSha":"55bb57d202de3b926896fa966c2c4a44c779634e","analyzedAt":"2026-09-04T12:50:26.162Z","contentChangedAt":"2026-09-04T12:50:26.162Z","schemaVersion":2},"datasetVersion":"2026-09-11T21:17:09.523Z"}