An enterprise bean with bean-managed transaction demarcation must not use the getRollbackOnly() and setRollbackOnly() methods of the EJBContext interface.
An enterprise bean with bean-managed transaction demarcation has no need to use these methods, because of the following reasons: � An enterprise bean with bean-managed transaction demarcation can obtain the status of a transaction by using the getStatus() method of the javax.transaction.UserTransaction interface. � An enterprise bean with bean-managed transaction demarcation can rollback a transaction using the rollback() method of the UserTransaction interface.
I think its like we are not supposed to interfere with the working of container.When we say we are going for BMT then we must pretty much adhere to it.
(2)Opinion for Question(2)
Stateless Session bean's creation and removal is tied to the container, so there may be an unspecified transaction context running during stateless session bean creation and context settings. This may be the reason why we cannot call setRollbackOnly() on the SessionContext object.
Expect Corrections from all... :roll:
SCJP 1.4<br />SCBCD 1.3
All of the world's problems can be solved in a garden - Geoff Lawton. Tiny ad:
how do I do my own kindle-like thing - without amazon