Hi All, I just started preparing for the SCBCD. I have a question on the OID of Stateful Session Bean. As per the Spec when a Client calls the Create method on the Home Object following sequence of steps occur.
1. Creates a new EJB Object 2. Create a Session Context Object 3. Creates a New Instance 4. calls setSesionContext 5. calls ejbCreate
My question here is why not steps 2 to 5 be performed by the EJB Object rather than EJB Home Object?.
Any restrictions on this? Am I missing something here?
Please refer the OID of Stateful Session Bean in EJB Spec (Figure 7) in case of any difficulty in understanding the above question. Thanks, Suresh R
i can think of 2 possible replies to this question
1. The responsibility lies with the Home object. Think about it... We are asking a Home object to create a Session bean for us. So, it should be the responsibility of the Home object to create an instance of *whatever* and return that to us..
2. The OID diagrams are for our understanding. A developer is supposed to think that it works that way.. Who knows how weblogic has implemented it or JBoss has implemented it...
Thanks Ganesh for that Reply. What I could interpret from your reply is, there is no harm in doing Steps 2-5 in EJB Object if any container developer wishes to.
posted 15 years ago
Originally posted by Suresh Ramamurthy: Thanks Ganesh for that Reply. What I could interpret from your reply is, there is no harm in doing Steps 2-5 in EJB Object if any container developer wishes to.
That is correct...
I sometimes find it very satisfying when i can visualize how the container vendor might have implemented it... Typically we dont care how the container provider implements it, but if it aids our understanding, then we definitely do care... dont we???