This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I have a question about the "bean things" that can be done at various stages in a session bean life cycle.
Ref page 216 HFEJB- if you see, we can't force transaction rollbacks or find if a transaction has been set for a rollback but we can get transaction references and call methods on them in the ejbCreate() ejbActivate() ejbPassivate and ejbRemove() methods.
The question is why is it that we can perform transaction related operations for BMT beans and not for CMT beans in these methods?
A session bean�s newInstance, setSessionContext, ejbCreate, ejbRemove, ejbPassivate, ejbActivate, and afterCompletion methods are called with an unspecified transaction context.
So, you cannot use SessionContext methods to force transaction to complete, this is wit CMT only. In BMT you can definately get TransactionContext from SessionContext in these methods manage to your transaction programatically.