Title: RE: clarification of CMP field initial values

Unfortunately I "think" that the spec requirement is to set the instance variables to the Java language defaults  and not defaults specified by the developer during declaration.

Thus EJB developers should do custom initialization in ejbCreate( ) and not during declaration of the instance variable. So String myString = "My default string value"; won't work for all ejb servers.

Please correct me if this is not the case.

> -----Original Message-----
> From: A mailing list for Enterprise JavaBeans development
> [mailto:[EMAIL PROTECTED]]On Behalf Of Jim Frentress
> Sent: Monday, November 15, 1999 12:26 PM
> To: [EMAIL PROTECTED]
> Subject: Re: clarification of CMP field initial values
>
>
> i think the spec is very clear on this point. simply put,
> init cm fields
> prior to create so users don't have to. users can init to
> desired values on
> create, but they shouldn't have to worry about "random
> values" in the cmp
> fields.
>
> > -----Original Message-----
> > From: Erik Voldal [SMTP:[EMAIL PROTECTED]]
> > Sent: Monday, November 15, 1999 12:08 PM
> > To:   [EMAIL PROTECTED]
> > Subject:      clarification of CMP field initial values
> >
> > In EJB1.1 section 9.4.2 there is the following statement:
> > "The Container must ensure that the values of the
> container-managed fields
> > are set to the Java language
> > defaults (e.g. 0 for integer, null for pointers) prior to
> invoking an
> > ejbCreate(...) method on an
> > instance."
> > I believe the intent of this statement is to require the
> container for CMP
> > fields to guarantee the same initial field values when
> calling ejbCreate,
> > regardless of whether the container actually creates a new
> Java instance
> > each time or whether it pools and recycles instances. 
> Therefore I believe
> > that if the CMP instance variable in the bean implementation were to
> > include an initializer (such as String myString = "My default string
> > value";), that the intent of the spec is to require
> container providers to
> > ensure the field has that declared initial value when the
> ejbCreate method
> > is called, and that the spec should be clarified to state that.
> > Comments?
> >
> > Erik Voldal
> > Email: [EMAIL PROTECTED]
> > Phone: 507-253-4788
> >
> >
> ==============================================================
> ============
> > =
> > 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