> res2.commit() will throw XAException.XA_RETRY exception
That's not JTA spec compliant behaviour. The XA spec allows it, but JTA does not.
I tried different XA exception to get it work, but so far failed.
Can you advice which Exception should it throw in order for the tx to be recovered?