{"record":{"id":"759318a35110e4c7","repo":"prestodb/presto","slug":"result-set-concurrency-must-be-concur-read-only","errorCode":null,"errorMessage":"Result set concurrency must be CONCUR_READ_ONLY","messagePattern":"Result set concurrency must be CONCUR_READ_ONLY","errorType":"exception","errorClass":"SQLFeatureNotSupportedException","httpStatus":null,"severity":"error","filePath":"presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoConnection.java","lineNumber":897,"sourceCode":"            throw new SQLException(\"Connection is closed\");\n        }\n    }\n\n    private void initializeQueryInterceptors()\n    {\n        for (QueryInterceptor interceptor : this.queryInterceptorInstances) {\n            interceptor.init(this.sessionProperties);\n        }\n    }\n\n    private static void checkResultSet(int resultSetType, int resultSetConcurrency)\n            throws SQLFeatureNotSupportedException\n    {\n        if (resultSetType != ResultSet.TYPE_FORWARD_ONLY) {\n            throw new SQLFeatureNotSupportedException(\"Result set type must be TYPE_FORWARD_ONLY\");\n        }\n        if (resultSetConcurrency != ResultSet.CONCUR_READ_ONLY) {\n            throw new SQLFeatureNotSupportedException(\"Result set concurrency must be CONCUR_READ_ONLY\");\n        }\n    }\n\n    private static void checkHoldability(int resultSetHoldability)\n            throws SQLFeatureNotSupportedException\n    {\n        if (resultSetHoldability != ResultSet.HOLD_CURSORS_OVER_COMMIT) {\n            throw new SQLFeatureNotSupportedException(\"Result set holdability must be HOLD_CURSORS_OVER_COMMIT\");\n        }\n    }\n\n    private static String getIsolationLevel(int level)\n            throws SQLException\n    {\n        switch (level) {\n            case TRANSACTION_READ_UNCOMMITTED:\n                return \"READ UNCOMMITTED\";\n            case TRANSACTION_READ_COMMITTED:","sourceCodeStart":879,"sourceCodeEnd":915,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoConnection.java#L879-L915","documentation":"PrestoConnection.checkResultSet() throws SQLFeatureNotSupportedException when resultSetConcurrency is not ResultSet.CONCUR_READ_ONLY. Presto result sets are read-only streams; updatable cursors (CONCUR_UPDATABLE) would require write-back to the result source, which the protocol does not support. Note this message is only reached when the type check at line 894 already passed.","triggerScenarios":"createStatement(anyType, ResultSet.CONCUR_UPDATABLE) or prepareStatement(sql, type, ResultSet.CONCUR_UPDATABLE) with a forward-only type.","commonSituations":"Framework-generated JDBC code that requests updatable result sets to allow row updates; porting legacy CRUD code that relied on updatable cursors from MySQL/PostgreSQL.","solutions":["Pass ResultSet.CONCUR_READ_ONLY as the concurrency argument","Perform modifications with explicit UPDATE/INSERT/DELETE SQL statements instead of ResultSet.updateRow()","Use prepareStatement(sql) defaults which are read-only"],"exampleFix":"// before\nStatement stmt = conn.createStatement(\n    ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_UPDATABLE);\n// after\nStatement stmt = conn.createStatement(\n    ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);","handlingStrategy":"validation","validationCode":"if (concurrency != ResultSet.CONCUR_READ_ONLY) {\n    concurrency = ResultSet.CONCUR_READ_ONLY; // coerce before calling driver\n}","typeGuard":null,"tryCatchPattern":"try {\n    stmt = conn.createStatement(ResultSet.TYPE_FORWARD_ONLY, concurrency);\n} catch (SQLFeatureNotSupportedException e) {\n    stmt = conn.createStatement();\n}","preventionTips":["Never request CONCUR_UPDATABLE with Presto; use SQL DML for writes","Audit framework configs for updatable-result-set options","Centralize statement creation with fixed read-only concurrency"],"tags":["jdbc","unsupported-feature","resultset","presto"],"backgroundTag":"sqlfeaturenotsupported","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"}