Hi Li
According to HF EJB page 228, I can get a reference to my EJB object in ejbCreate() for stateless session bean, but on page 225-227, it says bean creation is independent of the user, the EJB object is tied to the bean only when client calls a business method. So my question is if the EJB object is not tied to the bean during ejbCreate(), how can I get reference to EJB object? It does not make sense, right?
The bean is actually tied with the EJB object. When the container starts up, it will *PRE-CREATE" stateless session bean (depends on vendor whether this happens) and put those beans into the stateless bean pool.
Thus, when the client call ejbCreate(), it does NOT mean the client is now ask the container to create a new stateless bean, BUT it does ask the container to give him a stateless bean from the bean pool.
Does this make more sense?
For Stateful bean, when ejbCreate() invokes, it really DOES create the bean at the time that the method is called.
Nick.
SCJP 1.2, OCP 9i DBA, SCWCD 1.3, SCJP 1.4 (SAI), SCJD 1.4, SCWCD 1.4 (Beta), ICED (IBM 287, IBM 484, IBM 486), SCMAD 1.0 (Beta), SCBCD 1.3, ICSD (IBM 288), ICDBA (IBM 700, IBM 701), SCDJWS, ICSD (IBM 348), OCP 10g DBA (Beta), SCJP 5.0 (Beta), SCJA 1.0 (Beta), MCP(70-270), SCBCD 5.0 (Beta), SCJP 6.0, SCEA for JEE5 (in progress)