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:
MAP -> set errorFlag = 0
startTransaction1
[B]SEQUENCE (TRY & CATCH 1)[/b]
[B]SEQUENCE (TRY 1)[/b]
Invoke: local_trx_insertAdapterService1
startTransaction2
[B][COLOR=Navy]SEQUENCE (TRY & CATCH 2)[/color][/b]
[B][COLOR=Navy]SEQUENCE (TRY 2)[/color][/b]
Invoke: local_trx_insertAdapterService2
startTransaction3
[B][COLOR=Red]SEQUENCE (TRY & CATCH 3)[/color][/b]
[B][COLOR=Red]SEQUENCE (TRY 3)[/color][/b]
Invoke: local_trx_insertAdapterService3
[B][COLOR=Red] SEQUENCE (CATCH 3)[/color][/b]
rollbackTransaction3
MAP -> set errorFlag = 1
[COLOR=Navy][B]SEQUENCE (CATCH 2)[/b][/color]
rollbackTransaction2
MAP -> set errorFlag = 1
BRANCH (/errorFlag)
1: throwException
commitTransaction3
commitTransaction2
commitTransaction1
[B]SEQUENCE (CATCH 1)[/b]
rollbackTransaction1
EXIT from $flow and signal Failure
Note: throwException is simply a java service that throws a ServiceException.
#Integration-Server-and-ESB#webMethods#Flow-and-Java-services