cancel
Showing results for 
Search instead for 
Did you mean: 

Restarting a process

rodiaz
Champ in-the-making
Champ in-the-making
Hi there,

Is true that the current state of a process instance is only stored in database when the process execution reaches a wait state? I understand for wait state user and receive tasks.

When the server failes, I´m not able to know querying the history where was the flow when this happened. This is a real problem for me because I´d need restart the process.

Thanks in advanced
2 REPLIES 2

frederikherema1
Star Contributor
Star Contributor
When the server crashes, the transaction on the DB is left in an inconsistent state and is rolled back… So all variable-updates and process-changes are rolled back. If you make sure you  services use the same transaction, they get rolled back as well. If you have non-transactional services in the process I'm afraid you're on your own. This is the case with all combinations of transactional and non-transactional stuff anyways, not just activiti.

You can always make your service-task run asynchronously. This means that, when the process reaches the step in your process, It persists it's state and returns control to the tread. The execution of the service-task will be done by the job executor asynchronously. If you make all following service-tasks async, then after every execution of one, the state will be stored to the DB. This makes the frame of possible inconsistency much smaller.

bernd_ruecker
Champ in-the-making
Champ in-the-making
Ho Rodiaz.

I tries to explian the overall Activiti TX management in a bit more details here: https://app.camunda.com/confluence/display/foxUserGuide/Thread+and+Transaction+Management. Maybe that helps.

Cheers
Bernd