gpt4 book ai didi

java - JPA + Hibernate + 自动提交

转载 作者:塔克拉玛干 更新时间:2023-11-03 03:52:28 25 4
gpt4 key购买 nike

有人知道为什么我在 JPA 配置文件中关闭自动提交时会收到此警告吗?

使用此设置:

<property name="hibernate.connection.autocommit" value="false"/>

生成此警告:

2009-08-04 09:54:10,621 [main] WARN org.hibernate.ejb.Ejb3Configuration - hibernate.connection.autocommit = false break the EJB3 specification

这会如何破坏 EJB3 规范?

最佳答案

来自 EJB 3.0 规范的第 13.3.4 节:

The enterprise bean’s business methods, message listener methods, business method interceptor methods,life cycle call back interceptor methods, or timeout callback method must not use any resource-manager specific transaction management methods that would interfere with the container’s demarcation of transaction boundaries. For example, the enterprise bean methods must not use the following methods of the java.sql.Connection interface:commit, setAutoCommit, and rollback; or the following methods of the javax.jms.Session interface:commit and rollback.

关于java - JPA + Hibernate + 自动提交,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1228086/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com