AnsweredAssumed Answered

Failed to compensate (Transaction marked Rollback only )

Question asked by vivverma on Jul 8, 2013
Latest reply on Jul 11, 2013 by vivverma
Hi All,
The Problem is described below:-
1) My Application X has activiti engine embedded inside it to execute certain Workflows.
2) X utilizes global JTATransactionManager and an XA Datasource, and passes the same to Activiti while configuring SpringProcessEngineConfiguration.
3) The Workflow has two tasks T1 and T2.  T1 triggers a WS call to some external system. T2 executes a call to One of the Application's Transactional service API.
4) T2 call fails and marks the Trasaction Status to rollback, however the execption is caught in the Service Task so that a Compensation could be triggered.
5) Now T1 has compensation task defined.
6) Activiti tries to query the DB but fails as the Transaction has already been marked as rollback.

As i understand activiti heavily relies on the DB for its execution flow and as the transaction has already been marked as rollback, it encouters this Rollback Exeption.

Can anyone point me in the right direction as to how to overcome this issue.