• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Bean vs Instance Pooling

 
Ajai
Ranch Hand
Posts: 198
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I read somewhere that Bean Pooling is possible only for SLSB,does that mean
for entity and SFSB pooling (activation/passivation)we give a diff. name as instance pooling.
Is my understanding correct?

Thanks,
Ajai
 
Byron Estes
Ranch Hand
Posts: 313
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It really depends upon how they define pooling.

The thing that really matters is this.

The instances of a Stateless Session Bean are equivalent, so that any of them can handle an incoming request.

Stateful Session Beans carrry information specific to an ongoing conversation. In order to conserve finite resources a container passivates and activates the beans as needed. As a result, in memory there are some number of instances which depending upon the application server, it's configuration and the traffice might be increased, but in general they are reused through the act of activation and passivation. It's the same thing an operating system does to swap information in and out of RAM to virtual memory on a physical disk (context switching).

So, to me both are pooled, but stateless can be used by all at anytime, whereas a Stateful bean needed to go through activation before it can be made ready for it's caller and needs to go through passivation in order to make it available for the container to use for someone else.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic