问题描述
为什么 JTA 不支持嵌套事务?是因为实现它们的复杂性(我对此表示怀疑)还是某些设计原则?
Why aren't nested transactions supported by JTA? Is it because of the complexity of implementing them (which I doubt) or some design principle?
推荐答案
(正如@Piotr Nowicki 指出的,JTA 确实允许嵌套事务,但这是可选的,不是强制性的.)
(As @Piotr Nowicki points out, JTA does allow nested transactions, but this is optional not mandatory.)
为什么?这是无法确定地回答的问题之一,除非在做出决定时您是房间里"的人之一.
Why? This is one of those questions that is impossible to answer with any certainty, unless you were one of the people "in the room" when the decisions were made.
这可能是在规范中包含嵌套事务的固有复杂性.或者当时明显的复杂性;即,他们不确定自己知道如何做好指定它们.
可能是他们认为需求不足.
It could be that they thought there wasn't enough demand.
可能是时间压力……或者只是精疲力竭.
It could be time pressure ... or just plain exhaustion.
可能是商业原因";例如某些供应商不想通过扩大规范的范围来干扰产品发布计划.
It could be "commercial reasons"; e.g. certain vendors not wanting to interfere with product launch schedules by expanding the scope of the spec.
但是,最重要的是,如果您想要真正的答案,您需要询问编写 JTA 规范的工作组中的人员.(我怀疑他们会告诉你......在记录中.)
But, the bottom line is that if you want the real answer, you would need to ask the people in the working group that wrote JTA specifications. (And I doubt they would tell you ... on the record.)
这篇关于为什么 JTA 不支持嵌套事务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!