I don't think that the session is
always valid  inbetween servlet
invocations.
Websphere has the ability to
serialize the session out to a
database, and then de-serialize it
back when needed.
So you need to make sure that
your session data (de)serializes correctly
even when your background thread
is running!

I'd avoid the issue and do the fetch
in the doPost() when your user
logs in.

"RUTHERFORD, Mike" <[EMAIL PROTECTED]> wrote:
__________
>I've had a look at the archives and Jason Hunters book, however I still find
>myself unsure.
>
>What I want to do is to create a thread that will pre-fetch data into a
>specific session. The first servlet will create the session, kick off the
>prefetch thread and return. Subsequent servlets will make use of the
>prefetched data from the session and return immediately (they may also start
>other prefetch threads or retrieve extra data themselves as required). The
>last (logoff) servlet will invalidate the session.
>
>If I pass the HttpSession to the thread it seems like I should be able to
>save the data into it without too many worries. Will this stop the session
>from expiring normally? Are there any other gotchas I'm missing?
>
>I obviously want any running threads to end cleanly when the session ends
>for whatever reason. Should the thread implement HttpSessionBindingListener
>for this or should I just trap exceptions?
>
>I'm not sure if this will effect any suggestions/preoblems but I'm using
>VAJ/WebSphere 3.02 :-(
>
>Michael Rutherfurd
>
>http://www.westpoint.ltd.uk/

Internet reconnaissance services.

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to