It's interesting, I went back and read the spec on ejbCreate, and no-where
does it actually state that intiliation Must be performed in ejbCreate and
not the constructor. It is somewhat implied, but not actually stated.
In any event, since the beans context isn't set until After it's constructor
is called by newInstance, it does make sense to perform All initialization
in the beans ejbCreate methods.
-Chris.
> -----Original Message-----
> From: Dan OConnor [SMTP:[EMAIL PROTECTED]]
> Sent: Wednesday, May 24, 2000 2:20 PM
> To: [EMAIL PROTECTED]
> Subject: Re: Creation of objects in stateful EJB
>
> 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".
===========================================================================
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".