AnsweredAssumed Answered

ActivitiException causing rollback inspite of catching it

Question asked by hepci123 on Jul 16, 2014
Latest reply on Jul 25, 2014 by jbarrez

We are using Spring+Activiti+JTA in our application. The method that calls RuntimeService.startProcessInstanceByKey has a try catch for ActivitiException as we do not want the transaction to be rolled back when the exception occurs. But everytime ActivitException occurs I see that the transaction is getting rolled back, in my case jms queue is also transacted, so the roll back is causing the message to be redelivered causing an infitnite loop.

Tried many things to stop the roll back and redelivery of the message like
1. removed activiti retry by following the instructions given in , thinking that may be activiti retries on failure is causing the redelivery but bo luvk with it.
2. added noRollBackFor=ActivitiException.class at transactional annotation for the method that calls RuntimeService.startProcessInstanceByKey , still no luck ( as acitiviti is throwing this exception and not the my method that is calling activiti)
3. changed the propogation of this method to 'requries_new' but still bo use.

During my research, I read that Spring rollsback every runtime exception. As ActivitiException extends RTE, is there anyway I can stop Spring from marking this transaction for rollback. Been looking into this issue for a ouple days now and I'm getting nowhere. Any help in this regard is very much appreciated.