{"record":{"id":"8c63fee74e216d34","repo":"apache/shardingsphere","slug":"updatearray","errorCode":null,"errorMessage":"updateArray","messagePattern":"updateArray","errorType":"exception","errorClass":"SQLFeatureNotSupportedException","httpStatus":null,"severity":"error","filePath":"kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/resultset/AbstractUnsupportedUpdateOperationSQLFederationResultSet.java","lineNumber":424,"sourceCode":"    \n    @Override\n    public final void updateNClob(final String columnLabel, final Reader reader) throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"updateNClob\");\n    }\n    \n    @Override\n    public final void updateNClob(final int columnIndex, final Reader reader, final long length) throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"updateNClob\");\n    }\n    \n    @Override\n    public final void updateNClob(final String columnLabel, final Reader reader, final long length) throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"updateNClob\");\n    }\n    \n    @Override\n    public final void updateArray(final int columnIndex, final Array x) throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"updateArray\");\n    }\n    \n    @Override\n    public final void updateArray(final String columnLabel, final Array x) throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"updateArray\");\n    }\n    \n    @Override\n    public final void updateRowId(final int columnIndex, final RowId x) throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"updateRowId\");\n    }\n    \n    @Override\n    public final void updateRowId(final String columnLabel, final RowId x) throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"updateRowId\");\n    }\n    \n    @Override","sourceCodeStart":406,"sourceCodeEnd":442,"githubUrl":"https://github.com/apache/shardingsphere/blob/e952770a215630a3659c75d64369168cd3e26b82/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/resultset/AbstractUnsupportedUpdateOperationSQLFederationResultSet.java#L406-L442","documentation":"updateArray(int, Array) on a ShardingSphere federation ResultSet throws SQLFeatureNotSupportedException. Federation results are computed and merged in memory; there is no updatable row and no Array-typed column write path, so the updater base class rejects all Array updates by design.","triggerScenarios":"Calling rs.updateArray(columnIndex, array) (e.g. java.sql.Array created via Connection.createArrayOf) on the ResultSet of a federated SELECT, followed by rs.updateRow().","commonSituations":"Applications using PostgreSQL-style array columns through ShardingSphere proxy/JDBC with sql_federation enabled; generic schema-browsing or admin tools that attempt in-place edits of array columns.","solutions":["Write array values with a dedicated UPDATE (setArray, or the dialect's array literal syntax) instead of the ResultSet updater.","Remove the statement from federation routing (rewrite the SQL or disable sql_federation) if updatable cursors are required.","Prefer storing arrays as JSON and updating via setString if cross-database portability matters.","In shared JDBC code, catch SQLFeatureNotSupportedException and fall back to UPDATE."],"exampleFix":"// before\nArray arr = conn.createArrayOf(\"int\", new Integer[]{1,2});\nrs.updateArray(3, arr);\nrs.updateRow();\n\n// after\nArray arr = conn.createArrayOf(\"int\", new Integer[]{1,2});\ntry (PreparedStatement ps = conn.prepareStatement(\"UPDATE t SET tags = ? WHERE id = ?\")) {\n    ps.setArray(1, arr);\n    ps.setLong(2, id);\n    ps.executeUpdate();\n}","handlingStrategy":"try-catch","validationCode":"if (rs.getConcurrency() != ResultSet.CONCUR_UPDATABLE) { throw new IllegalStateException(\"ResultSet is not updatable; use UPDATE statement\"); }","typeGuard":null,"tryCatchPattern":"try { rs.updateArray(1, arr); } catch (final SQLFeatureNotSupportedException ex) { /* ps.setArray fallback */ }","preventionTips":["Persist array columns with explicit UPDATE statements.","Check rs.getConcurrency() before updater calls.","Avoid array-typed columns behind federation; prefer JSON for portability."],"tags":["jdbc","resultset","sql-federation","unsupported-operation","array"],"backgroundTag":null,"analyzedSha":"e952770a215630a3659c75d64369168cd3e26b82","analyzedAt":"2026-08-14T13:54:53.392Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}