Hi, I have made shopping cart using stateful session bean. I want that when the session expires the user's loginStatus field in a database table is set to 'N'. Can anyone please tell me how to catch this event of session getting expired. Is there any exception thrown or anything else? Please help me. Abhishek
Use HttpSessionListener to capture the session create/destroy events. After you initiate the stateful session bean, keep the EJBObject handle in session scope. In sessionDestroyed() method of HttpSessionListener implementation class, keep the code to call the stateful session bean's method which can change the login status in database.
It may solve your problem!!!
subject: How to end a session with stateful session bean?