Error while sending large data as input to process

Hi All,

I am getting the following error while a sending variable with Json value is created in camunda. I’m using MySQL as the Camunda engine db and it looks like it is because the variable content is big and Camunda is unable to store it into the engine database. Changing the table column type to blob type does not solve the issue. How can one overcome this?

"ENGINE-03004 Exception while executing Database Operation ‘INSERT HistoricVariableUpdateEventEntity[bbeecc8b-72a9-11ea-82b0-0a580ae94770]’ with message ‘\n### Error flushing statements. Cause: org.apache.ibatis.executor.BatchExecutorException: org.camunda.bpm.engine.impl.persistence.entity.HistoricDetailEntity.insertHistoricVariableUpdateEvent (batch index #2) failed. 1 prior sub executor(s) completed successfully, but will be rolled back. Cause: java.sql.BatchUpdateException: Data truncation: Data too long for column ‘TEXT_’ at row 1\n### Cause: org.apache.ibatis.executor.BatchExecutorException: org.camunda.bpm.engine.impl.persistence.entity.HistoricDetailEntity.insertHistoricVariableUpdateEvent (batch index #2) failed. 1 prior sub executor(s) completed successfully, but will be rolled back. Cause: java.sql.BatchUpdateException: Data truncation: Data too long for column ‘TEXT_’ at row 1’. Flush summary: \n [\n INSERT HistoricVariableInstanceEntity[bbeea575-72a9-11ea-82b0-0a580ae94770]\n INSERT HistoricVariableInstanceEntity[bbeea576-72a9-11ea-82b0-0a580ae94770]\n INSERT HistoricVariableInstanceEntity[bbeea577-72a9-11ea-82b0-0a580ae94770]\n INSERT HistoricVariableInstanceEntity[bbf0ef75-72a9-11ea-82b0-0a580ae94770]\n INSERT HistoricVariableInstanceEntity[bbff1f4a-72a9-11ea-82b0-0a580ae94770]\n INSERT HistoricVariableInstanceEntity[bbff465c-72a9-11ea-82b0-0a580ae94770]\n INSERT HistoricVariableInstanceEntity[bbffe2a0-72a9-11ea-82b0-0a580ae94770]\n INSERT HistoricVariableInstanceEntity[c2094bc5-72a9-11ea-82b0-0a580ae94770]\n INSERT HistoricVariableUpdateEventEntity[bbeecc89-72a9-11ea-82b0-0a580ae94770]\n INSERT HistoricVariableUpdateEventEntity[bbeecc8a-72a9-11ea-82b0-0a580ae94770]\n INSERT HistoricVariableUpdateEventEntity[bbeecc8b-72a9-11ea-82b0-0a580ae94770]\n INSERT HistoricVariableUpdateEventEntity[bbf0ef77-72a9-11ea-82b0-0a580ae94770]\n INSERT HistoricVariableUpdateEventEntity[bbff1f4b-72a9-11ea-82b0-0a580ae94770]\n INSERT HistoricVariableUpdateEventEntity[bbff6d6d-72a9-11ea-82b0-0a580ae94770]\n INSERT HistoricVariableUpdateEventEntity[bbffe2a1-72a9-11ea-82b0-0a580ae94770]\n INSERT HistoricVariableUpdateEventEntity[c20972d6-72a9-11ea-82b0-0a580ae94770]\n INSERT HistoricProcessInstanceEventEntity[bbeea574-72a9-11ea-82b0-0a580ae94770]\n INSERT HistoricDecisionOutputInstanceEntity[bbf0ef72-72a9-11ea-82b0-0a580ae94770]\n INSERT HistoricDecisionOutputInstanceEntity[bbf0ef73-72a9-11ea-82b0-0a580ae94770]\n INSERT HistoricDecisionInstanceEntity[bbf0ef6f-72a9-11ea-82b0-0a580ae94770]\n INSERT HistoricDecisionInputInstanceEntity[bbf0ef70-72a9-11ea-82b0-0a580ae94770]\n INSERT HistoricDecisionInputInstanceEntity[bbf0ef71-72a9-11ea-82b0-0a580ae94770]\n INSERT HistoricActivityInstanceEventEntity[EndEvent_1yogdd8:c20972d7-72a9-11ea-82b0-0a580ae94770]\n INSERT HistoricActivityInstanceEventEntity[ExclusiveGateway_0fv8xi5:bbff6d6e-72a9-11ea-82b0-0a580ae94770]\n INSERT HistoricActivityInstanceEventEntity[StartEvent_1:bbeecc88-72a9-11ea-82b0-0a580ae94770]\n INSERT HistoricActivityInstanceEventEntity[Task_0beakke:bbffe2a2-72a9-11ea-82b0-0a580ae94770]\n INSERT HistoricActivityInstanceEventEntity[Task_0dc678u:bbeecc8c-72a9-11ea-82b0-0a580ae94770]\n INSERT HistoricActivityInstanceEventEntity[Task_0pug1jv:bbff6d6f-72a9-11ea-82b0-0a580ae94770]\n INSERT HistoricActivityInstanceEventEntity[Task_0uknxj0:bbf0ef79-72a9-11ea-82b0-0a580ae94770]\n INSERT HistoricActivityInstanceEventEntity[Task_18o8x18:bbf07a3e-72a9-11ea-82b0-0a580ae94770]\n INSERT ByteArrayEntity[bbf0ef76-72a9-11ea-82b0-0a580ae94770]\n INSERT ByteArrayEntity[bbf0ef78-72a9-11ea-82b0-0a580ae94770]\n DELETE_BULK deleteAuthorizationsForResourceId {resourceId=bbeea574-72a9-11ea-82b0-0a580ae94770, resourceType=8}\n

@nitin6120000 You need to store large strings as CLOB.

This approach will not work. Use Typed Value API for storing larger string values.

Try like this below. Object values will be stored in another table as CLOB.

ObjectValue typedObjectValue = Variables.objectValue(largeString).create();
runtimeService.setVariable(execution.getId(), "largeString", typedObjectValue);

Thank you for your help, but it is not working.
Now process is going through, by using Typed API, but same error is coming at the end of process.

Can you check the column specification, i.e. is it varchar(255) or anything like that? In case there is such restriction, you could reconfigure the column definition.

It will be nvarchar(4000). Can be increased, but MySQL has row level limitations of bytes, upto 65535.

I am using long text. Earlier tried with Long Blob also