This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Customer Requirements for Developers and have Marcho Behler on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes Session bean on timeout write to database Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Customer Requirements for Developers this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Session bean on timeout write to database" Watch "Session bean on timeout write to database" New topic
Author

Session bean on timeout write to database

Michael ness
Greenhorn

Joined: Sep 09, 2002
Posts: 7
Hi,
I have a session bean which I use to store user login information. When this bean is created I also write information to a database such as a userid, what time they logged in etc.
Now when the session times out or the browser window is closed I'd like to be able to write to the database that this has happened. This way I can keep track of who is actively logged into the system.
Does anybody know if this is possible and how to do it.
Thanks
Dave Landers
Ranch Hand

Joined: Jul 24, 2002
Posts: 401
Add a HttpSessionBindingListener to the session, it'll get unbound notification when the session times out.
 
 
subject: Session bean on timeout write to database
 
jQuery in Action, 3rd edition