AnsweredAssumed Answered

TransactionManagement and async=true

Question asked by rene on Feb 13, 2014
Latest reply on Feb 18, 2014 by martin.grofcik
HI,

we are very puzzled about the transactions in Activiti. While testing we got other results than the documentation suggested when we use activiti:async="true".

By the documentation i understand that every time activiti:async="true" is configured the actual transaction is committed and a new one is created by the jobExecutor, right? That is true if you have two ServiceTask configured. In my test project i faced the following limitation to this behaviour.

1.) activiti:async="true" for a SubProcess is does not lead to a new transaction
2.) If you have more than one ServiceTask with activiti:async="true" in a row this only applies to the first activiti:async="true" configured.

Am I missing something? I hope you can help me on this. I faced the same issue in Version 5.12 and 5.14.

My config does look as follows:

    @Bean
    public SpringProcessEngineConfiguration processEngineConfiguration() {
        final SpringProcessEngineConfiguration engineConfiguration = new SpringProcessEngineConfiguration();
        final DataSource dataSource = activitiDataSource();

        engineConfiguration.setDataSource(dataSource);
        engineConfiguration.setTransactionManager(transactionManager);
        engineConfiguration.setDatabaseSchemaUpdate("drop-create");
        engineConfiguration.setJobExecutorActivate(true);

        return engineConfiguration;
    }

where the transaction manager is used for Activiti and my application db.

When needed I can provide a test project to verify my result.

Any help will be appreciate! thanks in advance,

Rene

Outcomes