I want to be clear regarding the bean pooling mechanism.
This is what I thing...In my assumptions I use 3 bean instance B1,B2,B3..
Stateless Session Bean:
In this the bean is not going to maintan the state of the client...
so the container creates and maintains a pool of bean instances say B1,B2,B3,...before the client actually arrives.As and when client calls a method,the container randomly picks a bean from the pool and attach to the
EJB Object of the client for the life-time of the method.After the method call is over,the bean is brought back to the pool by the container.
Here remove doen't have any effect on the bean.
Stateful Session Bean:
Here the bean has to maintain the state of the client.So when the client arrives a bean is instantiated.So say there are 3 client now connect to my website and they are actively using my bean.So there wud be 3 instance of bean B1,B2 and B3 attached to the respective EJBObject of clients C1,C2 and C3.Now lets us assume that a new client C4 arrives and due to the limitaion in the resources,container will passivate/serialize one my existing beans(B1,B2,B3).Say it serializes B3.So the sate of B3 is stored in hard-disk.
Now my question is will the container instantiate a new instance of bean say B4 or will the existing instance B3 which is passivated will be used???IS the passivation means,the bean state is stored in hard disk and bean instance is there to serve other client???it is confusing for me here..If somebody can help me it will be good.
Also what is the effect of calling ejbRemove Entity Bean:
Here the container maintains a pool of bean instances B1,B2,B3,..So when client creates or finds a entity row ...that data is fed into the bean instances B1,B2,B3,..After the instance interaction is over,if client C3 using B3 calls remove the data represented by B3 is removed,but the bean instance B3 is in the pool.So if a client comes and aks for a bean B3 is given after attaching his data..
here remove has effect on the data and not on the bean.
Here also I have the same question,Will the passivated bean instance B3 be used by other clients.