I have been pulling my hair while studying HFE book for "Bean things you can do " in a callback methods.
It is so confusing and I am sorry to say, not explained well.
Say for example, can anybody please explain (Page 347, why ejbActivate(), ejbPassivate and ejbRemove() methods in stateful session bean can get a transaction reference and call methods on it, but cannot do a CMT realted things.
It is page no 216, which also refers to others pages 199 and 207. Well it doesn't say anything about the obivious question one gets in their mind, looking at the valid bean things described in these pages.
According to spec
1. "Invoking the getRollbackOnly and SetRollbackOnly methods is disallowed if the session bean methods for which the container does not have a meaningful transaction context, and to all session beans with bean-managed transaction demaraction"
2. Accessing resource managers and enterprise beans is disallowed in the session bean methods for which the container does not have a meaningful transaction context or client security context.
Now if you look at ejbCreate, ejbRemove, ejbPassivate or ejbActivate of a stateful session bean in the above mention pages of HFE, it appears that they all don't allow SetRollbackOnly or getRollbackOnly but allow access to resources and other beans.
If the above is due to "not having meaningful transaction context" then it should not allow access to resource manager according to 2 point from the spec.
Well I just think HFE could have explained this. It really gets confusing.
Joined: May 29, 2004
This part is confusing for me too. May be if you understood, you can explain to me as why there has to be a meaningful transaction context to access resource manager and other beans.