cancel
Showing results for 
Search instead for 
Did you mean: 

Configuring transaction manager for activiti process engine.

susubhas
Champ in-the-making
Champ in-the-making
Hi,

In my application i have transactionManager already defined which is either JTA or Hibernate transaction manager depending on which server the app will be deployed on. I have configured SpringProcessEngineConfiguration to use this transactionManager, but activiti doesn't reuse existing transaction instead it creates new one for every action. For example if i am performing some action on my app in a transaction and as part of this action if there is some update to activiti engine, activiti is not using the existing transation, i am saying this because if the main action fails for some reason then even the activiti related update should be rolled back which i dont see happening.


Rgds,
Sujata
13 REPLIES 13

jbarrez
Star Contributor
Star Contributor
And to activiti i m passing the reference of this transaction manager.

That is indeed what is needed.

I guess activiti creates its own sessionFactory.

No, activiti certainly doesn't do that.

is it that the transaction manager is only managing the transaction for the sessions which it knows about???

No, once you pass an external transaction manager, activiti never tries to start or manage a transaction itselfs, it leaves all that to the transaction manager.
The only difference I see is that I didn't define a databaseType … maybe remove that.
Can you extract a very simple unit test that demonstrates the issue, similar to the test I posted above?

susubhas
Champ in-the-making
Champ in-the-making
Hi jbarrez,

I could reproduce the issue on my local machine, will soon upload it to Github.

Rgds,
Sujata

larswillrich
Champ in-the-making
Champ in-the-making
i dont know, but i could not find

<tx:annotation-driven transaction-manager="transactionManager"/>
in your spring xml file…  so the @Transaction annotation will be ignored?

jbarrez
Star Contributor
Star Contributor
Damn, that I didn't see that one … good point, and indeed probably the cause of seeing multiple transactions