Sorry if I am being dense, but what is the problem as long as in ejbLoad()
it uses context.getPrimaryKey() (which it does)? How can it get out of sync
with the real key, or rather, how can this make it possible to shoot
yourself in the foot?
> -----Original Message-----
> From: A mailing list for Enterprise JavaBeans development
> [mailto:[EMAIL PROTECTED]]On Behalf Of Rickard �berg
> Sent: Thursday, January 20, 2000 8:16 AM
> To: [EMAIL PROTECTED]
> Subject: Re: petstore: storing the userId
>
>
> Hi!
>
> Arno Schatz wrote:
> > I just saw in AccountEJB.java of the pet store example that
> they store the
> > primary key in an instance variable userId and use it only in method
> > getDetails(). On other places in the same file they use
> > context.getPrimaryKey(). From my understanding it should always use
> > context.getPrimaryKey(). Somebody knows how it should be?
>
> Tricky one. If you're doing BMP beans then storing it in an instance
> variable is a great way of shooting yourself in the foot way too easily
> (i.e. don't do it). OTOH, if you're doing CMP you have no choice but to
> store it in instance variables, but at least the variable will always be
> properly updated to contain the same value as getPrimaryKey() returns.
>
> So:
> If BMP -> AVOID!
> If CMP -> No choice; you have to do it.
>
> /Rickard
>
> --
> Rickard �berg
>
> @home: +46 13 177937
> Email: [EMAIL PROTECTED]
> http://www.dreambean.com
> Question reality
>
> ==================================================================
> =========
> 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".