I'm trying to understand how statefull beans works (I read the theatrical part and I know the difference between statfull and statelss beans ...), for that reason I created a statefull bean and a rest API to access it.
I find out that the container create/instantiate a bean with every request.
then I used a servlet to access the bean, and this time the container crate juste one bean.
So my questions are :
why does the container create many bean for rest API ?? I know that it consider each request as a separate client but how it knows, since rest API or servlet are accessed using http requests??
why it consider request when it comes from servlet as one client?? (therefor it create one bean) in my case (doing test localy) how to force the container to create more beans (how to simulate more than one client).
Thank you in advance