cancel
Showing results for 
Search instead for 
Did you mean: 

Activiti h2 db increases over time

fnoorie
Champ in-the-making
Champ in-the-making
Hi,

We have activiti integrated with our project and we see that if we fire over 2million requests the h2 db increases in size. Note: We have history as none.

For our use case once one request is completed we dont want any data in the h2 db. Also we have one processEngine serving all the requests.



7 REPLIES 7

fnoorie
Champ in-the-making
Champ in-the-making
Here is what our process engine configuration looks like:
<code>
<bean id="dataSource"
  class="org.springframework.jdbc.datasource.SimpleDriverDataSource">
  <property name="driverClass" value="org.h2.Driver" />
  <property name="url" value="jdbc:h2:mem:activiti;DB_CLOSE_DELAY=-1;MVCC=TRUE" />
  <property name="username" value="sa" />
  <property name="password" value="" />
</bean>

<bean id="transactionManager"
  class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
  <property name="dataSource" ref="dataSource" />
</bean>

<bean id="processEngineConfiguration" class="org.activiti.spring.SpringProcessEngineConfiguration"
  depends-on="dataSource,transactionManager">
  <property name="databaseType" value="h2" />
  <property name="dataSource" ref="dataSource" />
  <property name="transactionManager" ref="transactionManager" />
  <property name="databaseSchemaUpdate" value="create-drop" />
  <property name="jobExecutorActivate" value="false" />
  <property name="history" value="none" />
  <property name="deploymentResources" value="classpath*:activiti/*.bpmn" />
</bean>
</code>

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi,

Is the issue DB vendor specific?

Regards
Martin

jbarrez
Star Contributor
Star Contributor
>  if we fire over 2million requests

H2 is not a database to use for these kind of loads. Please switch to another db. If no history is stored, and process instances are completed the database should not be large in size.

fnoorie
Champ in-the-making
Champ in-the-making
For our process we need an in memory DB as we dont want to take the overhead of DB maintenance. We didn't find anything other than h2 available (supported by activiti).

Here is the breakdown of what is increasing over time (size in bytes):
ACT_GE_BYTEARRAY 259,185,536
ACT_RU_VARIABLE     259,186,760
ACT_RU_EXECUTION   259,187,568
ACT_GE_PROPERTY     428,208

We are wondering why the db is increasing over time since we are not maintaining any history and the processes complete without user intervention.

Note: We do store process variables but our understanding is that once the process completes the variables are deleted from the db.

jbarrez
Star Contributor
Star Contributor
The table you mention are runtime tables. What is in them? Is there data in them? If not, it could be H2 is simply bad at removing data, not much we can do about that.

> We do store process variables but our understanding is that once the process completes the variables are deleted from the db.

correct.

fnoorie
Champ in-the-making
Champ in-the-making
"> We do store process variables but our understanding is that once the process completes the variables are deleted from the db.

correct."

Is this true for non primitive variables as well? Most of our process variables are strings

jbarrez
Star Contributor
Star Contributor
It doesn't matter which variables types, all variables in Activiti are stored in the db, primitive or not