File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

stateless vs stateful session beans

 
Lucas Smith
Ranch Hand
Posts: 808
1
Android Eclipse IDE Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have read that in case of stateful session bean - every invocation which is performed on the same proxy reference will be handled by the same bean instance. I wonder how it is possible.
In servlets cookies have to be enabled (or URL rewritting, or hidden fields) in order to maintain conversational state. But I have not encountered on such requirement in case of stateful session beans. It seems that is is held automagically . Can someone reveal this secret?

Cheers!
 
Mikalai Zaikin
Ranch Hand
Posts: 3329
8
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am not sure about low level mechanism, but note: HTTPS does not need cookies to track the client (from servlet specifications), so I assume that some secured protocol used to invoke session bean and for sure if it's secured then the client must be known.
 
ramesh vanka
Greenhorn
Posts: 11
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
StatefulSession Bean:

Once client calls the Home.create() method, container creates EJBObject, Instanstiate the Session Bean and makes relation between ejbobject and sessionbean, then it will send EJBObject stub to client.

For each every client, container creates unique session bean.

So here one point to observer is, container makes the relationship between ejbobject and sessionbean.

When ever client makes call business method (Stub EJBObject), then in server side container will come into picture pick the corresponding bean to perform the business method.

Regards,
Ramesh V
 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
One other possibility to associate a certain proxy instance with a specific stateful EJB instance is that the proxy attaches some kind of identification token to the call that is made to the EJB. The EJB does not receive the call directly, but instead it goes to some kind of facade which, based on the identification token in the call selects the appropriate bean instance to serve the call.
Best wishes!
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic