{"record":{"id":"40308e9c928933c5","repo":"OtterMind/Chat2DB","slug":"largecellvalue-partialprevieweditrejected","errorCode":"largeCellValue.partialPreviewEditRejected","errorMessage":"largeCellValue.partialPreviewEditRejected","messagePattern":"largeCellValue\\.partialPreviewEditRejected","errorType":"validation","errorClass":"BusinessException","httpStatus":null,"severity":"warning","filePath":"chat2db-community-server/chat2db-community-domain/chat2db-community-domain-core/src/main/java/ai/chat2db/community/domain/core/impl/db/DbDmlExecutionServiceImpl.java","lineNumber":89,"sourceCode":"            if (result != null) {\n                sqlOperationLogRecorder.recordResultAsync(result, request.getSource());\n            }\n            return result;\n        } catch (RuntimeException e) {\n            sqlOperationLogRecorder.recordFailureAsync(executeRequest.getSql(), request.getSource(), e.getMessage());\n            throw e;\n        }\n    }\n\n    @Override\n    public void rejectPartialLargeValueOperations(DbSelectResultUpdateRequest request) {\n        if (request == null || CollectionUtils.isEmpty(request.getOperations())) {\n            return;\n        }\n        for (ResultOperation operation : request.getOperations()) {\n            if (containsLargeValuePlaceholder(operation.getDataList())\n                    || containsLargeValuePlaceholder(operation.getOldDataList())) {\n                throw new BusinessException(\"largeCellValue.partialPreviewEditRejected\");\n            }\n        }\n    }\n\n    private List<ExecuteResponse> executeAndRecord(DbDmlExecutionRequest request,\n            ExecuteFunction executeFunction) {\n        boolean operationLogged = false;\n        DbDlExecuteRequest executeRequest = requireExecuteRequest(request);\n        try {\n            List<ExecuteResponse> results = executeFunction.execute(executeRequest);\n            sqlOperationLogRecorder.recordResultsAsync(results, request.getSource());\n            operationLogged = true;\n            attachLargeValueTokens(executeRequest, results);\n            return results;\n        } catch (RuntimeException e) {\n            recordFailureIfNeeded(executeRequest, request.getSource(), operationLogged, e);\n            throw e;\n        }","sourceCodeStart":71,"sourceCodeEnd":107,"githubUrl":"https://github.com/OtterMind/Chat2DB/blob/5ee1e990e73fbcae1969dc554be254fedb3ab888/chat2db-community-server/chat2db-community-domain/chat2db-community-domain-core/src/main/java/ai/chat2db/community/domain/core/impl/db/DbDmlExecutionServiceImpl.java#L71-L107","documentation":"Thrown by rejectPartialLargeValueOperations when any ResultOperation in a DbSelectResultUpdateRequest contains a cell value (in dataList or oldDataList) starting with the prefix 'CHAT2DB_LARGE_VALUE_PREVIEW:'. Large cell values are stored server-side and replaced with preview tokens in partial result sets; editing a row that includes such a placeholder is rejected because the full value was never sent to the client and cannot be safely written back.","triggerScenarios":"Calling rejectPartialLargeValueOperations (or a select-result update that delegates to it) where at least one operation's dataList or oldDataList entry starts with 'CHAT2DB_LARGE_VALUE_PREVIEW:'. This happens when a query result was paginated/truncated and a large cell was replaced by a token.","commonSituations":"User edits a row in a result set where a LOB/CLOB/TEXT column exceeded the preview threshold and was replaced by a token; frontend submits a partial-preview row for update without first fetching the full value; bulk-edit operation includes a row with a truncated large value.","solutions":["Fetch the full large value for the cell before editing (resolve the token via the large-value-token API).","Exclude rows containing large-value placeholders from the edit batch.","Increase the preview threshold or fetch full results if editing large values is required."],"exampleFix":"// before\nupdateSelectResult(DbSelectResultUpdateRequest.builder()\n    .operations(List.of(ResultOperation.builder()\n        .dataList(List.of(\"CHAT2DB_LARGE_VALUE_PREVIEW:abc123\", \"newval\"))\n        .build()))\n    .build()); // -> partialPreviewEditRejected\n\n// after\n// resolve the token to the full value first, or exclude this row\nupdateSelectResult(DbSelectResultUpdateRequest.builder()\n    .operations(List.of(ResultOperation.builder()\n        .dataList(List.of(fullResolvedValue, \"newval\"))\n        .build()))\n    .build());","handlingStrategy":"validation","validationCode":"private static final String LARGE_VALUE_PREVIEW_PREFIX = \"CHAT2DB_LARGE_VALUE_PREVIEW:\";\nboolean hasPlaceholder = request.getOperations().stream()\n    .anyMatch(op -> containsPrefix(op.getDataList()) || containsPrefix(op.getOldDataList()));\n// where containsPrefix checks any cell startsWith(LARGE_VALUE_PREVIEW_PREFIX)\nif (hasPlaceholder) { /* resolve tokens or exclude rows before update */ }","typeGuard":"boolean rowIsEditable(List<String> row) {\n    return row == null || row.stream().noneMatch(v -> v != null && v.startsWith(\"CHAT2DB_LARGE_VALUE_PREVIEW:\"));\n}","tryCatchPattern":null,"preventionTips":["Resolve large-value preview tokens to full values before submitting edits.","Exclude rows containing preview placeholders from batch edits.","Surface a clear client-side message when a row contains an unresolved large value."],"tags":["large-value","partial-preview","edit-rejected","validation"],"backgroundTag":null,"analyzedSha":"5ee1e990e73fbcae1969dc554be254fedb3ab888","analyzedAt":"2026-08-14T07:05:03.077Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}