Why doesnt throwing an XAException from a XAResource still allow an transaction commit to succeed?
I am trying out a few things w/ JOTM and have some general purpose questions regarding how things work. I have listed the sequence of events to get a definitive summary of what happens.
- create tx
- enlist resource
- tx.commit
- resource.start
- resource.end throws XA EXCEPTION
- resource.commit
Even if the resource.end throws a XAException the tx commit will still work which seems plain wrong to me. Whats the point of throwing an exception if it doesnt m开发者_JAVA技巧ark the tx as rolled back ...
Do all tx managers work like this or does throwing an XAException fail the tx ?
TM behaviour depends not just on the existence of an XAException but on the XAException error code. Any of the (spec compliant) XA_RB∗ codes thrown from end should cause a rollback.
In my understanding of XA, ALL kinds of XAExceptions thrown during prepare MUST lead to rollback of the XA transaction.
HTH.
Thanks, Nitin
精彩评论