BMT交易可以与现有交易合并吗?
我发现在会话 bean 中,在使用容器管理事务时,可以使用事务属性(如 REQUIRED / SUPPORTS)将事务与现有的客户端事务结合起来。
在使用 Bean-Managed-Transaction 时,有没有办法使该事务与现有的客户端事务连接?
I find that in a session bean, while using Container-Managed-Transactions, the transaction can be made to join with the existing client-transaction using transactional attributes like REQUIRED / SUPPORTS.
While using Bean-Managed-Transaction, is there a way to make that transaction join with the existing client-transaction ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
否(请参阅规范中的第 13.6.1 节和第 13.6.2 节)。
但你为什么要这么做呢?如果 bean 打算加入在其他地方启动的事务,只需将 if CMT 设为 REQUIRED 即可。当一个 BMT bean 想要调用另一个 bean 时,情况是一样的。 BMT bean 控制事务划分,另一个 bean 使用 CMT 加入事务。
还要注意,在规范中,术语“客户端”指的是 Bean 的调用者,它可以是另一个 Bean、独立客户端或外部客户端(例如 Web 服务请求)。
No (See § 13.6.1 and § 13.6.2 in the spec).
But why would you do that anyway? If the bean is meant to join a transaction started somewhere else, just make if CMT with REQUIRED. It's the same situation when a BMT bean whan to call another bean. The BMT bean controls the transaction demarcation, and the other bean uses CMT to join the transaction.
Note also that in the spec, the term "client" refers to the caller of a bean, it can be another bean, a stand-alone client, or external client (e.g. web service request).