AnsweredAssumed Answered

Transaction Management: no rollback?

Question asked by gant on Oct 27, 2011
Latest reply on Oct 27, 2011 by trademak
Hi,

I try to figure out how transaction management exactly works.

I have a process model like this:
startEvent->receiveTask1->ServiceTask->endEvent.

In my 'ServiceTask' I call a spring-wired service that throws an Exception. According to the default Transaction Mgmt Strategy described here: http://www.activiti.org/userguide/index.html#asyncContinuations, I'd expect that the transaction would be rolled back and


Map<String, Object> vars = new HashMap<String, Object>();
       vars.put("exceptionService", new ExceptionThrowingService());
      String processInstanceId = runtimeService.startProcessInstanceByKey("errorHandlingErrorNoBoundaryEvent", vars).getId();
      runtimeService.signal(processInstanceId);
assertNotNull(runtimeService.createExecutionQuery().processInstanceId(processInstanceId).activityId("receiveTask1").singleResult());

in my JUnit test would evaluate to true.

Instead, runtimeService#signal crashes with an 'ActivitiException: Error while evaluating expressions'. What I caused by throwing an exception in my service.

So why is this transaction not rolled back?

I'm using Activiti 5.6

Regards,
michael

Outcomes