Why don't stateful session beans have a pool?

Showing Answers 1 - 4 of 4 Answers

Rajesh

  • Jun 6th, 2006
 

stateful session beans get instantiated once for each seperate client request and it stores the client information in it, there is no threading concept in EJB hence if there will be an instance pool will exist then there is a possiblity of information leak between different session objects.

therefore there is no concept of instance pooling in stateful session bean.

  Was this answer useful?  Yes

Srinivas Gorityala

  • Aug 11th, 2006
 

Incase of stateful session beans we usually use pooling concept.Incase of pool if client request comes a bean instance willbe taken and further operaions willbe done.After completion of operation bean instance won't remember state of client,so that bean instance canbe used once again for another client.

but in stateful session beans it requires state rememberance.so if a bean instance is provided for a client ,that is only for that client,it willnot be given to other client,so in his siuation passivation,acivation processes will come out.

pool is also same as cache,but pool won't remember state of client.

  Was this answer useful?  Yes

Sankar

  • Oct 15th, 2006
 

Hi,

We know that Stateful session beans are maintained a conversational state between the clients...and Stateful session bean's instance is only for a particular client ..the other clients can't use this instance io order access bean's method...

Instance pooling means that instances are grouped by the container for servicing the client's request...If we use instance pooling in Stateful Session Bean then the container takes more time to create the bean instances than it needs time to service those requests...It results the reduce in performance....

So we don't use instance pooling technique in Stateful Session Bean...

But in the case of Stateless Session beans we can use instance pooling in order to increase the performance....Because Stateless session beans don't maintain conversational state with the clients.it is possible to use the same instance for multiple clients...So a small no of instances can service a large no of clent's requests.....

  Was this answer useful?  Yes

keshab

  • Dec 13th, 2006
 

in statefull session bean there is 1to 1 mapping between ejbObject and bean instenace , there is no need of pool

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.