开发者

If a XAResource is the only resource involved in a Tx should the XAResource.prepare() be called

I am trying out a few things w/ JOTM and have some gene开发者_如何学JAVAral 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
  6. resource.commit

Why is resource.prepare never called and the flag to commit (onephase) is true. Is this the intended behaviour for such use cases ?


Why is resource.prepare never called and the flag to commit (onephase) is true

XA specification section 2.3.2:

One-phase Commit A TM can use one-phase commit if it knows that there is only one RM anywhere in the DTP system that is making changes to shared resources. In this optimisation, the TM makes its Phase 2 commit request without having made a Phase 1 prepare request.

Is this the intended behaviour for such use cases ?

yes

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜