Reputation: 3154
Does anybody know why I get this warning when I turn off the auto-commit in JPA configuration file?
Using this setting :
<property name="hibernate.connection.autocommit" value="false"/>
generates this warning :
2009-08-04 09:54:10,621 [main] WARN org.hibernate.ejb.Ejb3Configuration - hibernate.connection.autocommit = false break the EJB3 specification
How would this break EJB3 specification?
Upvotes: 9
Views: 27080
Reputation: 4782
From section 13.3.4 of the EJB 3.0 specification:
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.
Upvotes: 5