Container calls ejbFindxxx on the instance in pooled
state. Instance will be again in pooled state , so you do nothing
other than returning the keys.Container
only needs the primarykey/keys and then creates collection of
EJBObjects for primarykey/keys obtained
and then it either activates or creates instances
from the pooled instances to associate the EJBObjects.
For ejbFindByPrimaryKey() which returns a single key,
container might just activate the same instance on which it called
ejbFindByPrimaryKey()(This is vendor specific).

Srinivas





---Lars Hagrot <[EMAIL PROTECTED]> wrote:
>
> If the ejbFindXXX method only returns a collection of keys. Then it
must
> be stupid to return other attributes (colums) than key values in the
> jdbc-call in the ejbFindXXX method. The container instantiates the
whole
> objects from other calls (maybe a lot of calls? one per object?) or
> finds them in some sort of cache?
>
> My "question" is;  Is it a god design to implement ejbFindXXX methods
> with database calls that only return key values?
>
>
> Vlada Matena wrote:
>
> >  The ejbFindLargeAccounts(..) method must convert the ResultSet
into a
> > collection of primary keys,and return the collection as a method
> > result. The Container converts the collection of primary keysto a
> > collection of object references, and returns the collection of ORs
to
> > the client. Vlada
> >
> >      -----Original Message-----
> >      From: Damon Williams <[EMAIL PROTECTED]>
> >      To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
> >      Date: Wednesday, March 03, 1999 12:57 PM
> >      Subject: ejbFind() method return types
> >       On page 71 of the Spec (1.0), in section 9.7.5: "The return
> >      type of a finder method must be the enterprise Bean's
> >      primary key type, or a collection of objects of the primary
> >      key type." On page 72 in section 9.7.8: "The return type for
> >      a finder method must be the enterprise Bean's remote
> >      interface type, or a collection thereof." I don't understand
> >      the discrepancy!  Is this a typo?  Also, let's say we define
> >      an ejbFindLargeAccounts(double amount) method, in the body
> >      of which we execute the SQL query and receive a ResultSet
> >      back with a selection of rows from the database.  How then
> >      do we turn this data into a collection of Entity Bean remote
> >      interfaces, which is what section 9.7.8 requires us to
> >      return?  ---------------------------------------------------
> >
> >      Damon Williams
> >      Simplified Telesys
> >      Sun Certified Java Programmer
> >      www.simpletel.com
> >
> --
>
> ----
> Lars Hagrot                     E-mail: [EMAIL PROTECTED]
> Object Technology Mentoring      Phone: +46 8 638 50 00
> Enea Data AB                     Mobile: +46 70 582 98 31
> Box 232, S-183 23 T�by, Sweden   Fax: +46 8 658 57 90
>
> >
> begin:vcard
> n:Hagrot;Lars
> x-mozilla-html:FALSE
> org:Enea Data AB
> adr:;;Box 232;T�by;Sweden;S-183 23;Sweden
> version:2.1
> email;internet:[EMAIL PROTECTED]
> title:Object Technology Mentoring
> tel;fax:+46 8 658 57 90
> tel;home:Mobile: +46 70 582 9831
> tel;work:+46 8 638 50 00
> x-mozilla-cpt:;0
> fn:Lars Hagrot
> end:vcard
>

_________________________________________________________
DO YOU YAHOO!?
Get your free @yahoo.com address at http://mail.yahoo.com

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