cancel
Showing results for 
Search instead for 
Did you mean: 

about the history variables insert sql exception

fuhang
Champ in-the-making
Champ in-the-making
I have a problem about engine saving history variable causing exception.
this is my configuration:
<blockcode>
<bean id="processEngineConfiguration" class="org.activiti.engine.impl.cfg.StandaloneProcessEngineConfiguration">
      <property name="dataSource" ref="dataSourceDBCP"/>
      <!– none, activity, audit, full –>
      <property name="history" value="activity"/>
   </bean>
</blockcode>
when enable history property as activity (or audit or full),and I set the tow variables to start flow instance or complete the task with variables
,the exception is happening(below codes):

Map<String, Object> variables = new HashMap<String, Object>();
variables.put( "accepterDepartmentId", currentTaskParticipantDepartment );
variables.put( "responsibleParticipantId", currentTaskParticipantId );
//cause exception
taskService.complete( taskId, variables );
//cause exception
runtimeService.startProcessInstanceByKey( DepartmentWorkHandleFlowConstant.PROCESS_DEFINITION_KEY, formId, variables );
//this is oracle 12c/11g database, exception is:

org.apache.ibatis.exceptions.PersistenceException:
### Error updating database.  Cause: java.sql.SQLException: Invalid column type
### The error may involve org.activiti.engine.impl.persistence.entity.HistoricVariableInstanceEntity.bulkInsertHistoricVariableInstance_oracle-Inline
### The error occurred while setting parameters
### SQL: INSERT ALL                 INTO ACT_HI_VARINST (ID_, PROC_INST_ID_, EXECUTION_ID_, TASK_ID_, NAME_, REV_,       VAR_TYPE_, BYTEARRAY_ID_, DOUBLE_, LONG_ , TEXT_, TEXT2_, CREATE_TIME_, LAST_UPDATED_TIME_) VALUES            (?,            ?,            ?,            ?,            ?,            ?,            ?,            ?,            ?,            ?,            ?,            ?,            ?,            ?)                 INTO ACT_HI_VARINST (ID_, PROC_INST_ID_, EXECUTION_ID_, TASK_ID_, NAME_, REV_,       VAR_TYPE_, BYTEARRAY_ID_, DOUBLE_, LONG_ , TEXT_, TEXT2_, CREATE_TIME_, LAST_UPDATED_TIME_) VALUES            (?,            ?,            ?,            ?,            ?,            ?,            ?,            ?,            ?,            ?,            ?,            ?,            ?,            ?)                 INTO ACT_HI_VARINST (ID_, PROC_INST_ID_, EXECUTION_ID_, TASK_ID_, NAME_, REV_,       VAR_TYPE_, BYTEARRAY_ID_, DOUBLE_, LONG_ , TEXT_, TEXT2_, CREATE_TIME_, LAST_UPDATED_TIME_) VALUES            (?,            ?,            ?,            ?,            ?,            ?,            ?,            ?,            ?,            ?,            ?,            ?,            ?,            ?)                 INTO ACT_HI_VARINST (ID_, PROC_INST_ID_, EXECUTION_ID_, TASK_ID_, NAME_, REV_,       VAR_TYPE_, BYTEARRAY_ID_, DOUBLE_, LONG_ , TEXT_, TEXT2_, CREATE_TIME_, LAST_UPDATED_TIME_) VALUES            (?,            ?,            ?,            ?,            ?,            ?,            ?,            ?,            ?,            ?,            ?,            ?,            ?,            ?)                 INTO ACT_HI_VARINST (ID_, PROC_INST_ID_, EXECUTION_ID_, TASK_ID_, NAME_, REV_,       VAR_TYPE_, BYTEARRAY_ID_, DOUBLE_, LONG_ , TEXT_, TEXT2_, CREATE_TIME_, LAST_UPDATED_TIME_) VALUES            (?,            ?,            ?,            ?,            ?,            ?,            ?,            ?,            ?,            ?,            ?,            ?,            ?,            ?)                 INTO ACT_HI_VARINST (ID_, PROC_INST_ID_, EXECUTION_ID_, TASK_ID_, NAME_, REV_,       VAR_TYPE_, BYTEARRAY_ID_, DOUBLE_, LONG_ , TEXT_, TEXT2_, CREATE_TIME_, LAST_UPDATED_TIME_) VALUES            (?,            ?,            ?,            ?,            ?,            ?,            ?,            ?,            ?,            ?,            ?,            ?,            ?,            ?)                 INTO ACT_HI_VARINST (ID_, PROC_INST_ID_, EXECUTION_ID_, TASK_ID_, NAME_, REV_,       VAR_TYPE_, BYTEARRAY_ID_, DOUBLE_, LONG_ , TEXT_, TEXT2_, CREATE_TIME_, LAST_UPDATED_TIME_) VALUES            (?,            ?,            ?,            ?,            ?,            ?,            ?,            ?,            ?,            ?,            ?,            ?,            ?,            ?)                 INTO ACT_HI_VARINST (ID_, PROC_INST_ID_, EXECUTION_ID_, TASK_ID_, NAME_, REV_,       VAR_TYPE_, BYTEARRAY_ID_, DOUBLE_, LONG_ , TEXT_, TEXT2_, CREATE_TIME_, LAST_UPDATED_TIME_) VALUES            (?,            ?,            ?,            ?,            ?,            ?,            ?,            ?,            ?,            ?,            ?,            ?,            ?,            ?)              SELECT * FROM dual
### Cause: java.sql.SQLException: Invalid column type
at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:23)
   at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:147)
   at org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java:134)
   at org.activiti.engine.impl.db.DbSqlSession.flushBulkInsert(DbSqlSession.java:842)
   at org.activiti.engine.impl.db.DbSqlSession.flushPersistentObjects(DbSqlSession.java:811)
   at org.activiti.engine.impl.db.DbSqlSession.flushInserts(DbSqlSession.java:789)
   at org.activiti.engine.impl.db.DbSqlSession.flush(DbSqlSession.java:610)
   at org.activiti.engine.impl.interceptor.CommandContext.flushSessions(CommandContext.java:211)
   at org.activiti.engine.impl.interceptor.CommandContext.close(CommandContext.java:137)
   at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:66)
   at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:31)
   at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:40)
   at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:35)
   at org.activiti.engine.impl.RuntimeServiceImpl.startProcessInstanceByKey(RuntimeServiceImpl.java:81)

How to fix this?
6 REPLIES 6

trademak
Star Contributor
Star Contributor
Which version of Activiti are you using? Did you try to set the databaseType property of the process engine config to oracle?

Best regards,

fuhang
Champ in-the-making
Champ in-the-making
yes,I set the databaseType to 'oracle', the same exception was throwed as same as MySQL.
Error updating database.  Cause: java.sql.SQLException:  Invalid column type.
The error may involve org.activiti.engine.impl.persistence.entity.HistoricVariableInstanceEntity.bulkInsertHistoricVariableInstance_oracle-Inline
I found that exception caused by calling spring dao interface problem, but I can't modify the activity source code for some reason. there something to notice is my spring framework version is -3.0.5, I tried to the lasted spring framework and lasted database(oracle 11g/12c, MySQL 5.6.x)jdbc drivers, not used. I can't figure out how to fix it .

jbarrez
Star Contributor
Star Contributor
Which Oracle version? Can you try with setBulkInsertEnabled(false) on the processEngineCOnfiguration?

I'm not really following your comment about Spring DAO/Activiti source … can you describe your config setup a bit more?

fuhang
Champ in-the-making
Champ in-the-making
Your suggestion solved my problem, it's working now. Thanks a lot.
My Oracle version is Oracle 11g Release 2, spring dao framework version is 3.0.5 and hibernate uses 3.6 version.
I uploaded my config files.

swamy2156
Champ on-the-rise
Champ on-the-rise
I am also facing the similar problem like fuhang and my database version is Oracle 11g Release 2, spring dao framework version is 3.0.5. setBulkInsertEnabled(false)  means disabling bulk inserts. Can't we do bulk inserts to oracle database? What are the databases suports bulk inserts by Activiti?

thanks,
Swamy.

ak1801
Champ in-the-making
Champ in-the-making
I was facing same issue after upgrading to activiti-5.21 with postgres db 9.6. I am using SpringProcessEngineConfiguration to create process engine.
As suggested by jbarrez, it got resolved by setting setBulkInsertEnabled(false). But not clear why this issue arises at first place and how does bulk insert cause this. Do share your thoughts if you get any insights.

Thanks,
Akshit.