Are we talking CMP and not BMP beans here or both?
What happens is the spec designers decide no longer that ejbLoad will return
FinderExceptions?
> -----Original Message-----
> From: A mailing list for Enterprise JavaBeans development
> [mailto:[EMAIL PROTECTED]]On Behalf Of David Pinnington - Sun UK
> - Consultant
> Sent: Thursday, May 25, 2000 1:20 AM
> To: [EMAIL PROTECTED]
> Subject: Re: ejbFindByPrimaryKey & Database lookup
>
>
> I personally do exactly this.
>
> If you image the finder method actually doing a database lookup
> then you will be
> doing the following:
>
>
> ejbFindByPrimaryKey() - does database lookup (SELECT)
> if Entity Bean not loaded into server then
> create new EJB inmemory and populate using ejbLoad - (SELECT)
>
>
> So in this case you have done 2 database lookups which i think is
> much more
> expensive. The EJB clinet will still get the FinderException
> whichever way you
> do it so I always go with the finder simply returning the PK
> without doing a
> lookup.
>
> In fact I would go one step further - if ever I have a finder
> method (primary
> key or not) where I can get / calculate the primary key withough doing a
> database lookup I will (e.g. composite key etc).
>
> davep
>
> >
> > Hi,
> >
> > I just saw a bea slide which recommends to implement
> ejbFindByPrimaryKey by
> > just returning the parameter:
> >
> > String ejbFindByPrimaryKey(String pk)
> > {
> > return pk;
> > }
> >
> > This code does not perfom a database lookup.
> >
> > The above coding has consequences:
> > 1. if a bean with the specified pk does not exist,
> ejbFindByPrimaryKey will
> > not throw a FinderException. Instead, ejbLoad will fail (in which case a
> > FinderException can be thrown).
> > 2. No database lock is set to the tuple with the pk.
> >
> > Has someone out there experiences with the optimized code?
> >
> > Thanks,
> > Marc Volz
> > TLC, Germany
> >
> >
> ==================================================================
> =========
> > 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".
> >
>
> ----------------------------------
> Dave Pinnington - Sun Microsystems
> [EMAIL PROTECTED]
> tel: +44 (0)1223 418868
> fax: +44 (0)1223 420257
>
> ==================================================================
> =========
> 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".