I am storing session information in a stateful session bean. And storing that session bean in HTTPSession.
Is there any way to get a notification , when the HTTPSession is time out or invalidated?
If not, how do the stateful session bean cleans up its data(it is heavy in this case).
thanks,
Nazilin
-
Sateful session bean HTTPSession (6 messages)
- Posted by: Nazilin Vaheed
- Posted on: July 05 2001 11:23 EDT
Threaded Messages (6)
- Sateful session bean HTTPSession by Shaun Childers on July 05 2001 11:47 EDT
- Sateful session bean HTTPSession by Nazilin Vaheed on July 09 2001 13:56 EDT
-
Sateful session bean HTTPSession by Shaun Childers on July 11 2001 09:40 EDT
- Sateful session bean HTTPSession by Pankaj Vij on July 11 2001 12:19 EDT
- Sateful session bean HTTPSession by Nazilin Vaheed on July 17 2001 06:10 EDT
-
Sateful session bean HTTPSession by Shaun Childers on July 11 2001 09:40 EDT
- Sateful session bean HTTPSession by Nazilin Vaheed on July 09 2001 13:56 EDT
- Sateful session bean HTTPSession by Pete L on April 09 2002 12:59 EDT
-
Sateful session bean HTTPSession[ Go to top ]
- Posted by: Shaun Childers
- Posted on: July 05 2001 11:47 EDT
- in response to Nazilin Vaheed
To get a notification you would have to have the ejbPassivate() and/or ejbRemove() method do "something" such as publish a message - then you would have to have "something" receive the message and notify (nullify) the HttpSession about the timed-out session bean.
As for the session bean cleaning up its data, again, just put functionality in the ejbPassivate() and/or ejbRemove() methods of the bean to "clean up" whatever you wish.
As a side note, what is the design of the stateful session bean? What "state" are you trying to maintain across multiple HttpSession calls? Is it user account info, references to a list of some sort? ...? -
Sateful session bean HTTPSession[ Go to top ]
- Posted by: Nazilin Vaheed
- Posted on: July 09 2001 13:56 EDT
- in response to Shaun Childers
Shaun,
I am storing user input , in between different screens , before reaching the submit operation, which makes in persistant.
Is servlet API provide support for soemthing like on_SessionTimeOut() event or call back?
thanks,
Nazilin
-
Sateful session bean HTTPSession[ Go to top ]
- Posted by: Shaun Childers
- Posted on: July 11 2001 09:40 EDT
- in response to Nazilin Vaheed
I don't believe there is an on_SessionTimeOut() event or anything. The Session bean will clean up itself when it times out (container will, actually) if the HttpSession times out. As for notifying the bean that the HttpSession has timed out, as soon as the reference from the HttpSession to the Session bean is nullified (by HttpSession timeout), the Session will be lost also - at this point the container will call the ejbPassivate() on the Session bean, which is where you could provide your cleanup functionality. -
Sateful session bean HTTPSession[ Go to top ]
- Posted by: Pankaj Vij
- Posted on: July 11 2001 12:19 EDT
- in response to Shaun Childers
Hi Shaun
I cant seem to understand how the statefull session bean ( on app server) will know when an httpsession(on webserver) will expire?
Thanks
Tim -
Sateful session bean HTTPSession[ Go to top ]
- Posted by: Nazilin Vaheed
- Posted on: July 17 2001 18:10 EDT
- in response to Shaun Childers
thanks Shuan. -
Sateful session bean HTTPSession[ Go to top ]
- Posted by: Pete L
- Posted on: April 09 2002 12:59 EDT
- in response to Nazilin Vaheed
Hello... simple...
make your session bean implements the HttpSessionBindingListener interface from the servlet API. So before the jsp session which your session bean is in will expire, the method valueUnbound(HttpSessionBindingEvent event) will be called. In there you could do any code needed.
Bye!