cancel
Showing results for 
Search instead for 
Did you mean: 

Transactions - autocommit - atomicity

neville_sequeir
Confirmed Champ
Confirmed Champ
Creating this new topic as a follow up to the topic - http://forums.activiti.org/content/any-way-get-reference-created-task-task-create-listener

I have following two major actions in my test case which executes a simple process that has only one user task between start and end nodes.
1. Start a process.
2. Using TaskService execute a TaskQuery to get the user task.
3. Do some application specific thing not related to Activiti.

I get
null
as result from TaskQuery. And that seems to be because the Activiti data created by starting the process has not been committed to the database (as stated in the referenced topic). I have set autocommit to true on my datasource configuration. I cannot set it to true because I need to make sure all the three logical steps in my application, as mentioned above, are running in one transaction. Either everything should be committed or nothing should be committed.

How are folks resolving such atomicity need in using Activiti? Is there some setting either for Activiti or for iBatis/MyBatis which will/can make this work. Or is there a specific ProcessEngine configuration to use for such scenarios?

I know the out-of-box test cases that come with Activiti run sucessfully. But I am assuming that's probably only because by default the datasource setting for autocommit on database connections is true.

I have tried various different transaction managers and various different Activiti ProcessConfigurations.

Any and all pointers will be highly appreciated.
3 REPLIES 3

neville_sequeir
Confirmed Champ
Confirmed Champ
I meant to say, I have set autocommit to false.

trademak
Star Contributor
Star Contributor
I have to repeat myself, you don't have to do a Task query to get the task. The DelegateTask IS the Task you would get back from the Task query already. So why is this DelegateTask object not enough for you to work with?

Best regards,

neville_sequeir
Confirmed Champ
Confirmed Champ
I am not talking about the listener any more. That's is why started a separated topic. I think for now it suffices to address this third topic because I think that is the root cause of my issues - http://forums.activiti.org/content/spring-jpatransactionmanager-not-saving-activiti-entities-db
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.