如何在 Java EE 6 上使用可序列化事务?

发布于 2024-09-19 11:31:07 字数 184 浏览 2 评论 0原文

我正在学习事务管理的新注释,例如 @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW),但我无法找到如何使用 SERIALIZABLE 隔离 创建事务。这是否可以在每种方法的基础上进行,或者我必须在整个应用程序的连接上设置它?

I am learning the new annotations for transaction management, like @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW), but i could not find out how to create a transaction with SERIALIZABLE isolation. Is this possible on a per-method basis or i have to set it on the connection for the whole application?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(2

毁梦 2024-09-26 11:31:07

通常,事务隔离级别是在每个应用程序的连接 上设置的。

然而,例如在Weblogic服务器上的Spring中,您可以为每个事务设置隔离级别。请参阅此处,第 9.8.1 点。

Generally transaction isolation level is set on Connection, per application.

However, e.g. in Spring on Weblogic server, you can set isolation level per transaction. See here, point 9.8.1.

浮生面具三千个 2024-09-26 11:31:07

这是否可以在每种方法的基础上进行,或者我必须在整个应用程序的连接上设置它?

这在标准化方式中是不可能的,EJB 规范没有涵盖这一点。

但一些容器确实提供了对此的支持,如中所述
如何在 EJB 中设置每个方法的隔离级别3.

Is this possible on a per-method basis or i have to set it on the connection for the whole application?

This is not possible in a standardized way, this is not covered by the EJB specification.

But some containers do offer support for this as mentioned in
How can I set isolation levels per method in EJB 3.

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