Win a copy of Spring Boot in Practice this week in the Spring forum!
  • 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
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

statefulsessionbean

 
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Cowgirl and Author
Posts: 1589
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic