{"record":{"id":"410198a33da906c2","repo":"flowable/flowable-engine","slug":"not-supported-to-set-cached-value","errorCode":null,"errorMessage":"Not supported to set cached value","messagePattern":"Not supported to set cached value","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine/src/main/java/org/flowable/engine/impl/delete/BatchDeleteProcessConfig.java","lineNumber":565,"sourceCode":"\n        @Override\n        public byte[] getBytes() {\n            throw new UnsupportedOperationException(\"Not supported to get bytes\");\n        }\n\n        @Override\n        public void setBytes(byte[] bytes) {\n            throw new UnsupportedOperationException(\"Not supported to set bytes\");\n        }\n\n        @Override\n        public Object getCachedValue() {\n            throw new UnsupportedOperationException(\"Not supported to set get cached value\");\n        }\n\n        @Override\n        public void setCachedValue(Object cachedValue) {\n            throw new UnsupportedOperationException(\"Not supported to set cached value\");\n        }\n    }\n}\n","sourceCodeStart":547,"sourceCodeEnd":569,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine/src/main/java/org/flowable/engine/impl/delete/BatchDeleteProcessConfig.java#L547-L569","documentation":"The inner entity of BatchDeleteProcessConfig implements setCachedValue(Object) by throwing UnsupportedOperationException. The batch-delete configuration object participates in no entity cache, so writing a cached value is unsupported by design. Any call to setCachedValue on this instance throws.","triggerScenarios":"Calling setCachedValue(...) on the inner entity in BatchDeleteProcessConfig (BatchDeleteProcessConfig.java:565), typically from cache-update code that sets cached values on all variable entities.","commonSituations":"Cache synchronization after transaction commit; bulk variable update utilities blindly writing cached values; reusing a variable entity wrapper where a config object was passed instead.","solutions":["Do not call setCachedValue on the batch-delete configuration entity.","Guard cache writes with an instanceof check for a cacheable entity type.","Pass a persistent variable entity to code expecting cached-value support."],"exampleFix":"// before\nentity.setCachedValue(value);\n// after\nif (entity instanceof VariableInstanceEntity) {\n    ((VariableInstanceEntity) entity).setCachedValue(value);\n}","handlingStrategy":"validation","validationCode":"if (entity instanceof VariableInstanceEntity) {\n    ((VariableInstanceEntity) entity).setCachedValue(value);\n}","typeGuard":"boolean acceptsCachedValue = (entity instanceof VariableInstanceEntity);","tryCatchPattern":null,"preventionTips":["Skip cached-value writes for entities flagged as non-cacheable.","Keep batch-delete config objects out of generic entity-cache update loops."],"tags":["unsupported-operation","batch-delete","flowable"],"backgroundTag":"unsupported-operation","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-18T11:17:12.947Z"}