• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How Session Bean maintains its session.

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,
I have a doubt regarding the stateful session bean. Correct me
if my understanding is wrong.
Statefull session bean have activate and passivate methods. Hope u know the need for that. When i execute passivate method, the ejb
container will store the session details in storage(memory or hard
disk ,vary based on vendors). By the same way if i execute activate
method, the container get the session for me from the storage.
My doubt here is how the container keep track of this user
information.How it is maintaining the session for the user and how
its identifying the stateful session object.
My understanding is thru cookies or URL rewriting.....
DO U HAVE ANY ANSWERS???
Thanks,
Prem
 
Ranch Hand
Posts: 219
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Prem..
I am not sure if u have access to the O'reilly book on Enterprise Java Beans. In the book which covered ejb 1.1, the explanation u seek is on pg. 55. Its a bit lengthy.. so i am taking this short cut..
if u dont have the book, let me know.. i shall make the effort of typing the pages out!
Prasad.
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Firstly, it's the EJB Container that calls ejbActivate() and ejbPassivate(), not you. The EJB Container may at some point decide that a particular SessionBean instance it not going to be used for a while and that it can be passivated to disk. The EJB Container again activates the instance when the instance receives a method call.
The EJB Container associates method calls to particular SessionBean instances based on RMI object references. The client has an RMI stub of the EJB and when she makes an invocation, the stub knows how to communicate with the EJB Container and let it know which EJB instance this particular reference refers to. If you happen to know CORBA's IORs, this is exactly the same thing.
 
Ranch Hand
Posts: 2713
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This topic actually comes up quite frequently around here. You may find these two posts helpful:
Stateful Session Bean question
Question on Statefull Session bean
 
reply
    Bookmark Topic Watch Topic
  • New Topic