Jose,

What will be the issues if they include this in the EJB Specs, so that they
provide another method which can load multiple beans using one query. Will
that be against the concept of EJB?

In my case, the return result may be 50, 100 etc, so if the container fires
50, 100 queries to database it is going to degrade the performance. If its 5
or 6 queries , I can go with your idea of losing little performance for all
the things which EJB provides.

Ben

-----Original Message-----
From:   Jose González Gómez [mailto:[EMAIL PROTECTED]]
Sent:   Thursday, September 21, 2000 3:51 AM
To:     [EMAIL PROTECTED]
Subject:        Re: ejbFindBy & ejbLoad

        Ben,

        ejbLoad and ejbFindxxx are callback methods that are to be called by
the
EJB container. It's obvious the lost in performance but in programming
there's always been this kind of tradeoff from the beginning of times. You
are losing performance, but you are gaining a lot in other aspects, like
security, transaction control, clear distinction between bussiness logic and
persistence... It's up to you to decide if you want to lose some performance
to gain all of these. (I hope you are not one of those guys that prefer to
program machine code so they "don't lose the control" ;o)

        regards
        Jose

-----Mensaje original-----
De: A mailing list for Enterprise JavaBeans development
[mailto:[EMAIL PROTECTED]]En nombre de Franklin, Benjamine
Enviado el: miércoles, 20 de septiembre de 2000 20:30
Para: [EMAIL PROTECTED]
Asunto: ejbFindBy & ejbLoad


Hi all,

  I'm creating a BMP enitybean. I'm confused about the correct way of coding
ejbFindBy & ejbLoad

  If I code as below, the number of select statements fired to database is
equal to the number of  number of primary keys returned by ejbFindBy

  Enumeration ejbFindByXXX( y )
  {
        execute select .. from abc where x=y
             return listOf primaryKeys;
  }

  ejbLoad()
  {
        execute select .. from abc where primaryKey=primaryKey.value
  }

--------------------------
Instead I want do everything in one query, so I want to do something like
below

  Enumeration ejbFindByXXX( y )
  {
        execute select .. from abc where x=y

             create entity beans from the result and add to container

             return listOf primaryKeys;
  }

  ejbLoad()
  {
       don't do anything
  }

Now the doubt is how do I create new entity bean, I don't think I can do new
MyBean(), is there anyway using EJBHome or EntityContext I can achieve this.
If this is not possible, isn't the Entity Bean concept has some serious
performance problem, where as the traditional jdbc program can do this is in
one query?

Ben

This message is for the named person's use only.  It may contain
confidential, proprietary or legally privileged information.  No
confidentiality or privilege is waived or lost by any mistransmission.
If you receive this message in error, please immediately delete it and all
copies of it from your system, destroy any hard copies of it and notify the
sender.  You must not, directly or indirectly, use, disclose, distribute,
print, or copy any part of this message if you are not the intended
recipient. CREDIT SUISSE GROUP and each of its subsidiaries each reserve
the right to monitor all e-mail communications through its networks.  Any
views expressed in this message are those of the individual sender, except
where the message states otherwise and the sender is authorised to state
them to be the views of any such entity.
Unless otherwise stated, any pricing information given in this message is
indicative only, is subject to change and does not constitute an offer to
deal at any price quoted.
Any reference to the terms of executed transactions should be treated as
preliminary only and subject to our formal written confirmation.

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


This message is for the named person's use only.  It may contain
confidential, proprietary or legally privileged information.  No
confidentiality or privilege is waived or lost by any mistransmission.
If you receive this message in error, please immediately delete it and all
copies of it from your system, destroy any hard copies of it and notify the
sender.  You must not, directly or indirectly, use, disclose, distribute,
print, or copy any part of this message if you are not the intended
recipient. CREDIT SUISSE GROUP and each of its subsidiaries each reserve
the right to monitor all e-mail communications through its networks.  Any
views expressed in this message are those of the individual sender, except
where the message states otherwise and the sender is authorised to state
them to be the views of any such entity.
Unless otherwise stated, any pricing information given in this message is
indicative only, is subject to change and does not constitute an offer to
deal at any price quoted.
Any reference to the terms of executed transactions should be treated as
preliminary only and subject to our formal written confirmation.

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