File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB and other Java EE Technologies and the fly likes Stateless Session Bean Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Stateless Session Bean" Watch "Stateless Session Bean" New topic
Author

Stateless Session Bean

Prashanth Bhanu
Ranch Hand

Joined: Sep 25, 2003
Posts: 110
Hi Friends,
Have a doubt,In deployment descriptor if i specify minimum pool size as 10.suppose 3 beans if we have then how many instances of each bean is going and sitting in the pool when the server is started?.How does the container decides on this?
Please clarify my doubt.Thanks in advance.
Thanks in adavnce
Prashanth
Valentin Tanase
Ranch Hand

Joined: Feb 17, 2005
Posts: 704
Hi Prashanth,

Usually the container will allow you to configure the initial number of beans in the free pool and the maximum number of beans in the pool (at least this is what WebLogic does). When the container starts up it will create exactly as many instances as the first parameter indicates (defaults to 0). As the client requests grow, the container will create more bean instances in the pool, up to the second parameter. If at any time you�ll have more client requests than the maximum number of beans in the pool, then the extra requests will be blocked and will be resumed after the instances become available. If no instance is available and the transaction times out, then the container will throw an exception.
Regards.


I think, therefore I exist -- Rene Descartes
Prashanth Bhanu
Ranch Hand

Joined: Sep 25, 2003
Posts: 110
Hi Valentin Tanase,
thanks for the reply.I've say 3 EJB's say 1)EJB1.2)EJB2.3)EJB3(all stateless).Let us assume minimum poolsize is 10.Now when the server is started we know it creates 10 beans in the pool.
My doubt is How many bean instances of EJB1,EJB2,EJB3 are created in the pool.IS it going to create number of beans as this equation says,
(EJB1 instances+EJB2 instances+EJB3 instances = 10).
Please help me to undersatnd it better.
Thanks in advance
prashanth
Phani Kumar
Greenhorn

Joined: Feb 15, 2002
Posts: 22
Prashant,
Correct me if I am wrong. According to my knowledge, this is bean specific. For each bean, you will mention the pool size, max beans in pool, min. number of beans to start with etc. So all your beans ejb1, ejb2, ejb3 will be maintained in separate pools.
Gurumurthy Ramamurthy
Ranch Hand

Joined: Feb 13, 2003
Posts: 273
10 beans instances for each, so totally 30 bean instances would be created.
Valentin Tanase
Ranch Hand

Joined: Feb 17, 2005
Posts: 704
Hi Prashanth,

Both Phani and Guru are right: each type of bean has its own pool and you�ll end up having 30 bean instances in 3 different pools. There is one more caveat to this one though. Sometimes containers use to cache the heavy ejb objects (for entity and SFSB only) and they will allow deployers to control the size of the cache in a similar manner. Having three different caches for three different types of ejb, won�t be always the most optimal approach: some cache could be very busy while others might not. So how to distribute the load then? Well the container (WebLogic in this case) will allow combining these three caches in only one, overcoming this problem.
Regards.
Prashanth Bhanu
Ranch Hand

Joined: Sep 25, 2003
Posts: 110
Hi Valentin ,Guru,Phani,
thank you very much for making me to understand.
Thanks
Prashanth
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Stateless Session Bean