cancel
Showing results for 
Search instead for 
Did you mean: 

Db connections number

alper
Champ in-the-making
Champ in-the-making
Hi,
I use Activiti Enginein my webapp deployed on JBoss.
I don't use jdbc directly, but JNDI datasource:


processEngine = ProcessEngineConfiguration
            .createStandaloneInMemProcessEngineConfiguration()
            .setDatabaseSchemaUpdate(
                  ProcessEngineConfiguration.DB_SCHEMA_UPDATE_TRUE)
            .setDataSourceJndiName("java:jboss/datasources/ActivitiDS")


I enabled pooling in JBoss by adding into the standalone.xml:


                    <pool>
                        <min-pool-size>50</min-pool-size>
                        <max-pool-size>200</max-pool-size>
                        <prefill>true</prefill>
                    </pool>


But anyway when I concurrently start 100 workflows in separate threads by doing:


runtimeService = processEngine.getRuntimeService();
               ProcessInstance startProcessInstanceByKey = runtimeService
                     .startProcessInstanceByKey("emptyParent", request);

I am getting freezed threads and exception at the end:

Error updating database.  Cause: org.h2.jdbc.JdbcSQLException: Timeout trying to lock table "ACT_HI_PROCINST";.

How to cure that?

2 REPLIES 2

alper
Champ in-the-making
Champ in-the-making
It works without exception for 50 concurrent threads, but for 100 threads 4 of them freeze with this exception.

alper
Champ in-the-making
Champ in-the-making
Ok, I increased pool size in the JBoss and everything works well