• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

using Connection or Session to commit

 
Himai Minh
Ranch Hand
Posts: 1361
7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
On p.49 of Grits notes
Transaction Management type is Bean,...the instance should not use the resource-manager specific transaction API (commit or rollback method on the Java.SQL.connection interface or on the Java.jms. session interface )

I think this should be related to transaction management type Container instead of Bean.
It is because JSR 318 says so in 13.3.4 Enterprise Bean using container managed transaction demarcation.
 
Frits Walraven
Creator of Enthuware JWS+ V6
Saloon Keeper
Pie
Posts: 2536
113
Android Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It applies for both CM and BM:


13.3.3 Enterprise Beans Using Bean-Managed Transaction Demarcation
While an instance is in a transaction, the instance must not attempt to use the resource-manager specific transaction demarcation API (e.g. it must not invoke the commit or rollback method on the java.sql.Connection interface or on the javax.jms.Session interface).
and

13.3.4 Enterprise Beans Using Container-Managed Transaction Demarcation
The enterprise bean’s business methods, message listener methods, business method interceptor methods, lifecycle callback interceptor methods, or timeout callback methods 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic