Last Resource Optimization

。_饼干妹妹 提交于 2019-12-03 22:45:49

问题


I'm writing a Resource Adaptor which does not support two phase commit. I know there is an optimization technique called: "Last Resource Optimization".

On JBoss your XAResource class should implement LastResource in order to have the optimization.

My question is: how this can be done in WebLogic, WebSpehre, Glassfish, etc...


回答1:


Weblogic: AFAIK (may be very wrong) only JDBC drivers can be used with LRO, and it's a purely administrative task. When a driver doesn't support XA, it can be configured to be used with LRO: "Select this option if you want to enable non-XA JDBC connections from the data source to emulate participation in global transactions using JTA".

Essentially, LRO tolerates a resource that has no prepare phase, and can only be committed or rolled back. Thus, if only one such resource exist in XA-transaction, we may first attempt to prepare all others, then commit that LRO one, then, if succeed, commit others, otherwise rollback others.

You see, there is no special need in declaring any interface. It's an algorithm that can work with any non-XA resource. I'm not sure why JBoss has it, but I don't expect other servers have something similar.



来源:https://stackoverflow.com/questions/132295/last-resource-optimization

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!