• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Multiple Entity Beans

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
Can anyone explain to me the following scenario:
When I am invoking a ejbFind.. method on a home object reference and I am getting a collection. This collection will consist of 100 EJBObjects. Now will 100 different biz beans will be created for each EJBObject??
Also how many instances of EJBHome object will be created. Will this not be a performance issue?
S Rao
 
Saloon Keeper
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
One instance of the EJB Home is sufficient - it's only required to create or locate the EJB's themselves.
WHen you do a "find" operation and get 100 results, the actual results are typically actually only the primary keys of the matching objects, and the primary keys are fairly lightweight. Only when you actually reference the EJB will the primary key be used to load the full EJB.
Still, for best performance, you will want to keep the size of the match set as small as is reasonable and not hold onto it any longer than necessary.
 
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
rao,
When you are invoking ejbFindBy.....() you are reutrning an enumeration of the remoteInterfaces, what i think is happening is for each that for each EJBObject you are returning the row in the database.
What i would do if i knew that the size of the colletion is very high i would go for a JDBC object from my session bean rather than go for an entity bean.
Hope this helps
Kareem
 
Hey, sticks and stones baby. And maybe a wee mention of my stuff:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic