Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Multiple Entity Beans  RSS feed

 
s rao
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • 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
 
Tim Holloway
Bartender
Posts: 18661
71
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • 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.
 
Kareem Qureshi
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • 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
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!