Transaction scope with EJB's and XA Datasource?

Hi guys,

Our camunda process calls some EJB’s as delegates (delegate expression), which call JPA+Hibernate. We are using a XA Datasource both for EJB’s and for the process Engine, configured into our standalone.xml, with JBoss EAP 6.4 and our camunda version is 7.8.

Let’s suppose this situation, I’d like to know if my assumptions are correct. For this piece of process:

ServiceTask1 (calls EJB1) → ServiceTask2 (calls EJB2) → ManualTask

I assume that there is one single distributed/coordinated transaction that involves:

  • tx1 for ServiceTask1 and ServiceTask2 inside Camunda
  • tx2 for EJB1 method call and tx2 for EJB2
  • all these 3 tx’s are coordinated into a single distributed one: it is all or nothing that is commited, both in the camunda’s process instance and in our database.

Am I right?
How would this change if the datasource would not be XA?

Thanks a lot in advance :slight_smile: