Using JTA Block in Child Process Flow

Situation:

I have two process flows (Master flow and Child Flow). Both the flows include JTA blocks. My child flow is getting aborted if I include the JTA block inside it and is running successfully if removed.

 

Cause:

Whenever JTA Begin action is executed, it creates a new user transaction boundary and associate it with current Process Flow thread. In our case, JTA Begin is executed in Parent Process Flow and a new user transaction boundary is associated with Parent Process Flow thread. Now, if you call Sub-Process Flow (having its own JTA Begin – JTA End) using Call action in Parent Process Flow, then it will try to associate a new user transaction boundary (for Sub-Process Flow) with Parent Process Flow thread (as Call action executes Sub-Process Flow in same thread where Parent Process Flow executes). This operation of associating two user transactions to a single thread (a.k.a. nested transactions) is not supported by JOTM (Transaction Manager implementation used by Adeptia).

 

Solution:

Call the Sub-Process Flow using Spawn action instead of Call action in Parent Process Flow. If it is mandatory to use Call action in Parent Process Flow (in order to execute Sub-Process Flow in main thread), then you need to replace Call action with combination of “Spawn - Synch” action (with same signal name).

Have more questions? Submit a request

0 Comments

Article is closed for comments.