On 24 May 00, at 10:33, Chris Raber wrote:

Hi Chris,

> Don't use the constructor in EJB.
> The container doesn't call it (it uses
> Class.newInstance()).
>

This is true, but I believe the no-arguments constructor will still be
executed with a Class.newInstance call.  The class is instantiated
as if by a new expression with an empty argument list.  This is a
point about Java and not about EJB.  I agree that you still shouldn't
use the constructor.

This is correct:

> Put your intialization in ejbCreate()
>
> -Chris.
>
> > -----Original Message-----
> > From: Roger Kjensrud [SMTP:[EMAIL PROTECTED]]
> > Sent: Wednesday, May 24, 2000 12:37 PM
> > To:   [EMAIL PROTECTED]
> > Subject:      Creation of objects in stateful EJB
> >
> > I have a stateful session bean that uses a couple of java objects. I
> > wonder
> > where is the best place to create these, in ejbCreate() or in the
> > constructor? Is there a difference?
> >
> > Any thoughts are appreciated,
> >
> > Roger Kjensrud
> >
> > ==========================================================================
> > =
> > 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".

Reply via email to