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
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop