• 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
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

EJB Design

 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In an Entity Bean, if a finder method returns a large number of records (say thousands of them), will thousand bean instances be created? If yes, what happens if the number of bean instances required to be created exceed the number of instances which have been specified to be maintained in the pool?
I know this question would have been asked many times in many forums, but I haven't been able to get a convincing reply. Can anyone answer me?
 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi ,
>>In an Entity Bean, if a finder method returns a large number of records (say thousands of them), will thousand bean instances be created?
This depends on the Application Server that you are using. Most application servers do what is called as 'lazy loading'. When a finder method returns say 100 records, 100 Component Interfaces are created. Its only when you call a method on the bean that a bean instance is created.
>>If yes, what happens if the number of bean instances required to be created exceed the number of instances which have been specified to be maintained in the pool?
If your application server does'nt implement lazy loading & creates a 100 bean instances, well in this case your application server could hang.
>>I know this question would have been asked many times in many forums, but I haven't been able to get a convincing reply. Can anyone answer me?
Hope I was able to clear your doubt !!

Sowmya
http://www.pramati.com
 
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Sowmya BC:

This depends on the Application Server that you are using. Most application servers do what is called as 'lazy loading'. When a finder method returns say 100 records, 100 Component Interfaces are created. Its only when you call a method on the bean that a bean instance is created.


Correct me if I'm wrong but aren't BEAN INSTANCES managed by the container and usually put in a pool ?
I understood that when you call a method on a component interface the container activates a pre-loaded bean from the pool (transfers it from unused to used) and loads the data into it. Only after this process the BEAN INSTANCE receives the method call priorly invoked on the component interface.

So 100 component interfaces would be created but these could use for example the maxiumum of 20 BEANS from the pool as they are activated and passivated as nescesary.

Dave
 
These are not the droids you are looking for. Perhaps I can interest you in a tiny ad?
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic