BMT交易可以与现有交易合并吗?

发布于 2024-09-07 18:36:08 字数 141 浏览 5 评论 0原文

我发现在会话 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

呆橘 2024-09-14 18:36:08

否(请参阅规范中的第 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).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文