Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

question on statefull session bean

 
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
my question is about statefull session bean,how does the container remember the state of the conversation, I mean to rememeber the client is there anything in the stubs and skeletons that helps remember the bean instance on the server side? or is there something else?, what happens if I close the Browser or system shut down on the client side and restart again, can I still remember the conversation ? please explain.

thanks
Pradeep
 
Ranch Hand
Posts: 211
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

to rememeber the client is there anything in the stubs and skeletons that helps remember the bean instance on the server side? or is there something else?


There is nothing in the spec that mentions how this should work. But yes, the container may use some kind of mechanism in the stub of remote object impl to uniquely identify the client so that it knows that a sequence of method invocation came from the same client.

what happens if I close the Browser or system shut down on the client side and restart again, can I still remember the conversation ? please explain.


Nope, unless your code uses Handles and shuts down gracefully.

The container may identify orphaned objects and destroy them if they time-out. The time-out interval is generally specified by the deployer in a vendor specific way. Again the spec does not mandate this. Container may or may not use time-out. If it finds a session object lurking around beyond time-out interval, the container may simply remove them.

Note that even if you use Handles, you may end up getting java.rmi.NoSuchObjectException if the container has already removed the session object (due to time-out) by the time you try to get the EJBObject associated with the handle.
[ February 28, 2005: Message edited by: Keerthi P ]
 
Popeye has his spinach. I have this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic