Uploaded image for project: 'camunda BPM'
  1. camunda BPM
  2. CAM-11072

ENGINE-03083 ORA-01401: inserted value too large for column HistoricVariableInstanceEntity.insertHistoricVariableInstance

    • Icon: Bug Report Bug Report
    • Resolution: Duplicate
    • Icon: L1 - Blocker L1 - Blocker
    • None
    • None
    • camunda modeler
    • None
    • Production

      We are getting below error , please advised what needs to be done to resolve the issue, it is impacting our users. Let me know if you need more details asap.

      ENGINE-03083 Exception while executing Batch Database Operations with message '\n### Error flushing statements. Cause: org.apache.ibatis.executor.BatchExecutorException: org.camunda.bpm.engine.impl.persistence.entity.HistoricVariableInstanceEntity.insertHistoricVariableInstance (batch index #1) failed. Cause: java.sql.BatchUpdateException: ORA-01401: inserted value too large for column

        This is the controller panel for Smart Panels app

            [CAM-11072] ENGINE-03083 ORA-01401: inserted value too large for column HistoricVariableInstanceEntity.insertHistoricVariableInstance

            Garima Yadav added a comment -

            Hi amitjain4

            Thank you for reaching out to us. We have also created a SUPPORT ticket https://app.camunda.com/jira/browse/SUPPORT-6670 in order to track the progress of this issue.

            Here is an explanation for the issue:

            This error can occur if you store huge string or large amount of data in a variable of type "String". Internally, the process engine uses a VARCHAR field which has a limit of maximum 4000 characters (it varies for different databases) to store a variable of type String.

            If you need to store longer documents, you can tell the process engine to persist a String as a Java Serializable value. This can be done the following way using the Java API:

            import org.camunda.bpm.engine.ProcessEngine;
            import org.camunda.bpm.engine.RuntimeService;
            import org.camunda.bpm.engine.runtime.ProcessInstance;
            import org.camunda.bpm.engine.variable.Variables;
            import org.camunda.bpm.engine.variable.Variables.SerializationDataFormats;
            
            public class SomeClass {
            
              protected ProcessEngine processEngine;
            
              public void startProcess() {
            
                String aLongStringValue = repeat("a", 5000);
            
                RuntimeService runtimeService = processEngine.getRuntimeService();
            
                VariableMap variables = Variables.createVariables();
                variables.putValueTyped("var", Variables
                          .objectValue(aLongStringValue)
                          .serializationDataFormat(SerializationDataFormats.JAVA)  // tells the engine to use java serialization for persisting the value
                          .create());
            
                // Start a process instance
                ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("testProcess", variables);
              }
            
              protected String repeat(String string, int times) {
                StringBuilder sb = new StringBuilder();
                for (int i = 0; i < times; i++) {
                  sb.append(string);
                }
                return sb.toString();
              }
            }
            

            The snippet

            variables.putValueTyped("var", Variables
                          .objectValue(aLongStringValue)
                          .serializationDataFormat(SerializationDataFormats.JAVA)
                          .create());
            

            creates a process variables that is going to be serialized using standard Java serialization. The serialized byte stream is then stored in the database in a byte array field of arbitrary length.

            For general documentation on process variables and the different value types, please see the user guide https://docs.camunda.org/manual/7.11/user-guide/process-engine/variables/

            Best regards,
            Garima

            Garima Yadav added a comment - Hi amitjain4 Thank you for reaching out to us. We have also created a SUPPORT ticket https://app.camunda.com/jira/browse/SUPPORT-6670 in order to track the progress of this issue. Here is an explanation for the issue: This error can occur if you store huge string or large amount of data in a variable of type "String". Internally, the process engine uses a VARCHAR field which has a limit of maximum 4000 characters (it varies for different databases) to store a variable of type String. If you need to store longer documents, you can tell the process engine to persist a String as a Java Serializable value. This can be done the following way using the Java API: import org.camunda.bpm.engine.ProcessEngine; import org.camunda.bpm.engine.RuntimeService; import org.camunda.bpm.engine.runtime.ProcessInstance; import org.camunda.bpm.engine.variable.Variables; import org.camunda.bpm.engine.variable.Variables.SerializationDataFormats; public class SomeClass { protected ProcessEngine processEngine; public void startProcess() { String aLongStringValue = repeat( "a" , 5000); RuntimeService runtimeService = processEngine.getRuntimeService(); VariableMap variables = Variables.createVariables(); variables.putValueTyped( " var " , Variables .objectValue(aLongStringValue) .serializationDataFormat(SerializationDataFormats.JAVA) // tells the engine to use java serialization for persisting the value .create()); // Start a process instance ProcessInstance processInstance = runtimeService.startProcessInstanceByKey( "testProcess" , variables); } protected String repeat( String string, int times) { StringBuilder sb = new StringBuilder(); for ( int i = 0; i < times; i++) { sb.append(string); } return sb.toString(); } } The snippet variables.putValueTyped( " var " , Variables .objectValue(aLongStringValue) .serializationDataFormat(SerializationDataFormats.JAVA) .create()); creates a process variables that is going to be serialized using standard Java serialization. The serialized byte stream is then stored in the database in a byte array field of arbitrary length. For general documentation on process variables and the different value types, please see the user guide https://docs.camunda.org/manual/7.11/user-guide/process-engine/variables/ Best regards, Garima

            amit jain added a comment -

            Please delete the jira , we have raised the ticket with support.

            amit jain added a comment - Please delete the jira , we have raised the ticket with support.

            Garima Yadav added a comment - - edited

            closing as it is a duplicate of https://app.camunda.com/jira/browse/SUPPORT-6670

            Garima Yadav added a comment - - edited closing as it is a duplicate of https://app.camunda.com/jira/browse/SUPPORT-6670

              Unassigned Unassigned
              amitjain4 amit jain
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: