You can also switch to a servlet container that supports v2.3 of the Servlet
specification, such as Catalina (Tomcat v4.0).  The new servlet spec
supports event handling, and there is an event for the timeout of sessions.
You can add a listener for these events, and do any necessary cleanup when
the session times out.  Of course, you'd need to add some extra logic to do
additional cleanup at startup, in the event of a hard failure in the servlet
container.

-dan

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Toby Hede
Sent: Monday, July 30, 2001 11:34 PM
To: [EMAIL PROTECTED]
Subject: Re: [JBoss-user] Design Question...


another way to approach this is through the datbase itself, writing a
trigger to remove the data and setting a schedule for processing. most
modern rdbms systems have similar implementations



----- Original Message -----
From: "C Murphy @ Intechtual" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, July 31, 2001 3:15 AM
Subject: Re: [JBoss-user] Design Question...


> Hey Tim,
>
> If I correctly understand your qutestion, this is more of a servlet type
session management issue.  Take a look at the
javax.servlet.http.HttpSessionBindingListener interface.  It's basically a
callback interface for when a session expires.   Objects in the session,
that implement the interface,  will be messaged that they are being removed
from the session so that they can respond accordingly (in your case call
your Entity or whatever to remove the user/session relationship from the
data store).  So regardless if your user logs out explicity, or the session
expires due to inactivity, your object can be notified and do the
appropriate clean up.
>
> Hope this helps.
> Chris Murphy
>
> On Mon, 30 Jul 2001 16:45:41 +0100, Tim Yates <[EMAIL PROTECTED]>  wrote:
> > Hi there!!
> >
> > When a user hits the site, they get allocated a unique 48 character
session
> > ID (allocated by me).  If they then login, I tie that sessionId to a
userId
> > (both rows in seperate tables)
> >
> > But I have a design question...  They can log-out, but many do not
> > (obviously), so what would be the best way of clearing out-of-date
> > sessionIds at regular intervals?
> >
> > As far as I can see, I have two choices...
> >
> > 1) A seperate java server which runs through the instance table every
hour
> > or so, and calls my EJB's to delete those rows that have become inactive
> >
> > or 2) Use a Timer MBean to callback after a certain time to remove the
> > row...
> >
> > I am thinking that option 2 would be a much cleaner way of doing things,
but
> > what would be the way to do it?
> >
> > Sorry if I am talking rubbish, I have been searching for tutorials, and
> > books all afternoon, and the Web (and Amazon) has come up dry :(
> >
> > Thanks for any input you can give :)
> >
> > Tim Yates
> >
> >
> > _______________________________________________
> > JBoss-user mailing list
> > [EMAIL PROTECTED]
> > http://lists.sourceforge.net/lists/listinfo/jboss-user
>
> _______________________________________________
> JBoss-user mailing list
> [EMAIL PROTECTED]
> http://lists.sourceforge.net/lists/listinfo/jboss-user
>


_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user


_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to