While it is true that create() and ejbCreate() methods for a stateless bean
cannot take any parameters, but when a client calls create() method on a
stateless bean, ejbCreate() is not called on the bean instance. When an EJB
server starts up, it creates a certain amount of stateless bean instances,
calls the ejbCreate() method for each of them and stores them in the pool.
Subsequently, when a client invokes create() method on the home, the server
simply picks up an instance randomly and associates it to the EJBObject. This
is significantly different from Entity and Stateful beans for which, the
create() method is despatched to the corresponding ejbCreate() method.
I hope my understanding is correct. If there is anything wrong, please correct
me. Thanks.
Vivek Singh wrote:
> The container pools the instances of the beans. When multiple clients call
> create()......ejbCreate method of the bean will be called in all the
> instances of the pooled bean......then the client is handed over an
> EJBObject.
> Same happens for statefull session beans...the difference is u can pass
> parameters to the create method and the matching ejbCreate(.....) will be
> called in that instance. Same for entity beans.......the instance can be
> cached in this case if used before.
>
> -----Original Message-----
> From: Samuel Abraham [mailto:[EMAIL PROTECTED]]
> Sent: Monday, August 14, 2000 6:07 PM
> To: [EMAIL PROTECTED]
> Subject: Life cycle of beans(Session and entity)
>
> Hi all,
> I have a doubt regarding bean life cycle(Session and Entity).
> Assume that many clients are calling the create() method of a stateless
> session beans.
> Will the ejbCreate() be called whenever the create() method is called?
> What will be the scenario in the case of stateful and entity beans?
> TIA
> Samuel
>
> ________________________________________________________________________
> Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com
>
> ===========================================================================
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff EJB-INTEREST". For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".
>
> ===========================================================================
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff EJB-INTEREST". For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".