File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB and other Java EE Technologies and the fly likes statefulsessionbean Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "statefulsessionbean" Watch "statefulsessionbean" New topic
Author

statefulsessionbean

eswar kumar
Ranch Hand

Joined: Oct 20, 2002
Posts: 98
how a stateful session bean maintain state (every time the request is coming from that particular client)? if the client wants to browse after 30 mints of idle time how the bean instance knows that request is coming from that parcticular client?
Kathy Sierra
Cowgirl and Author
Ranch Hand

Joined: Oct 10, 2002
Posts: 1572
Howdy,
How the Container actually associates the stateful session bean with a particular client is up to the vendor.
You can imagine that the stub object contains enough information to identify the client uniquely to the Container, and that this information is enough for the Container to pull a bean out of passivation and restore its state when the client comes back and makes another method call.
But the exact implementation mechanism the Container uses to uniquely identify a client, and to restore state after passivation (or even HOW and IF the Container passivates stateful session beans) is not part of the spec, and is entirely the choice of the vendor.
cheers,
Kathy


Co-Author of <a href="http://www.amazon.com/exec/obidos/ASIN/0596007124/ref=jranch-20" target="_blank" rel="nofollow">"Head First Design Patterns"</a><br /> <br />Just a Jini girl living in a J2EE world.
vinod
Greenhorn

Joined: Nov 26, 2003
Posts: 1
Actually what happens when client is idle are not invoking any method or using stateful bean, container detects its idleness and prepare to passivate to free resources used by it. during passivation container calls ejbPassivate method on bean and save all non transient state of bean class in secondary memory. Along with data it also stores references of ejbObject, ejbContext, Home Object which are not released by client during passivation. So when passivated clent call some method on ejbObject associated with it, it retrives references and previous conversational state and activate bean.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: statefulsessionbean