• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

question on statefull session bean

 
pradeep arum
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
 
Keerthi P
Ranch Hand
Posts: 203
  • 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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic