开发者

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.

  1. create tx
  2. enlist resource
  3. tx.commit
  4. resource.start
  5. resource.end throws XA EXCEPTION
  6. 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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜