Yes, I tried with XA_TRANSACTION and it succeeded.
But I read somewhere in this forum that said XA_TRANSACTION is not recommended because of the complexity. What does that mean?
What’s the pros and cons between XA Transaction and Local Transaction?
I tried successfully with a nested startTransaction-commitTransaction/rollbackTransaction solution for LOCAL_TRANSACTION, but it makes the code become complex, especially if there is more than two transaction.
Example solution code with three local transaction calls:
Updating multiple resources within a single transaction is the root of the complexity.
If you’re updating 3 resources (and that cannot be factored out of the integration in some way) then using XA transaction will simplify your flow code (call startTransaction just once, do all 3 updates, then commit/rollback–XA will make sure all or none succeed). While this simplifies the flow, it is relatively complex behind the scenes and troubleshooting can be troublesome.
If you find you’ve created a nasty nested flow service like the example above, break the nested try/catches into their own services. This can help readability tremendously.