[EMAIL PROTECTED] wrote:

> Hi,
>
> I just saw a bea slide which recommends to implement ejbFindByPrimaryKey by
> just returning the parameter:

    Just to clarify, I never recommended that this is how to code
ejbFindByPrimaryKey.  Your first attempt should always be to code
ejbFindByPrimaryKey to check the persistent store for existence.

    This technique was presented as an optimization where the bean developer
*knew* that the key existed.

    Unfortunately slides are really only a small part of the presentation.
You are missing the words.

-- Rob

Rob Woollen
Senior Software Engineer
BEA WebLogic
[EMAIL PROTECTED]

>
>
> 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".

===========================================================================
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