AnsweredAssumed Answered

insert into ACT_RU_VARIABLE failing with java.lang.IllegalArgumentException: NaN

Question asked by espe on May 28, 2017
Latest reply on Jun 6, 2017 by bassam.al-sarori

Hello,

 

I have a pretty much big process with approximately 1.000 steps. When I start the process I get the following exception:

 

org.apache.ibatis.exceptions.PersistenceException:
### Error updating database. Cause: java.lang.IllegalArgumentException: NaN
### The error may involve org.activiti.engine.impl.persistence.entity.VariableInstanceEntity.insertVariableInstance-Inline
### The error occurred while setting parameters
### SQL: insert into ACT_RU_VARIABLE (ID_, REV_, TYPE_, NAME_, PROC_INST_ID_, EXECUTION_ID_, TASK_ID_, BYTEARRAY_ID_, DOUBLE_, LONG_ , TEXT_, TEXT2_) values ( ?, 1, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )
### Cause: java.lang.IllegalArgumentException: NaN
at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:23)
at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:150)
at org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java:137)
at org.activiti.engine.impl.db.DbSqlSession.flushInserts(DbSqlSession.java:761)
at org.activiti.engine.impl.db.DbSqlSession.flush(DbSqlSession.java:593)
Truncated. see log file for complete stacktrace
Caused By: java.lang.IllegalArgumentException: NaN
at oracle.jdbc.driver.OraclePreparedStatement.setDoubleInternal(OraclePreparedStatement.java:6599)
at oracle.jdbc.driver.OraclePreparedStatement.setDouble(OraclePreparedStatement.java:6574)
at oracle.jdbc.driver.OraclePreparedStatementWrapper.setDouble(OraclePreparedStatementWrapper.java:193)
at org.apache.ibatis.type.DoubleTypeHandler.setNonNullParameter(DoubleTypeHandler.java:28)
at org.apache.ibatis.type.DoubleTypeHandler.setNonNullParameter(DoubleTypeHandler.java:23)
Truncated. see log file for complete stacktrace

 

Now, the interesting part is that it fails randomly. It can fail on step 2, or even step 999. It can even complete the whole process successfully and then fail after it has completed. I can assure you that the data remain exactly the same between different executions.

The process consists exclusively of service tasks (no human actors) which perform some calculations. So the result variables which are stored in activiti variables are mainly numbers or arrays of numbers (which can reach large sizes - e.g. 8.000).

I am working with Activiti version 5.17.0 on an Oracle 12c database.

 

Any ideas? I am thinking of performance issues. I make a calculation, then Activiti takes too much time to write the result into the database but the next step tries to retrieve the same value. Are steps being executed sequentially? For sure I am not using any parallelism components (split and join etc)

Outcomes