We have a custom tag that is in every JSP that creates a socket connection to a target
server and
POSTs some data do a page on the target server that writes the data to a database. The
issue we
are having is that we don't want to delay the user's response by doing the socket
connection
synchronously. If we do the socket connection asynchronously we risk having the data
not being
sent when the server is under stress. I have not verified that this is occuring with
the custom
tag yet, but we are seeing it happen using ASP with an HTTP component. I am pretty
sure that the
same condition will occurr. So I would like for the JSP to start a thread to do the
socket
connection, run in the background, and return the response immediately so there is no
delay to the
user. I am thinking that when the response finishes the thread that it started will
also die. Is
that correct?
--- Ted Husted <[EMAIL PROTECTED]> wrote:
> What is it that you are actually trying to do?
>
> (The end to which keeping this thread alive is a means?)
>
> *********** REPLY SEPARATOR ***********
>
> On 12/26/2000 at 10:54 AM David M. Holmes wrote:
>
> But when the page finishes and there is no reference to the threaded
> object, won't the thread die?
>
> --- William Brogden <[EMAIL PROTECTED]> wrote:
> >
> >
> > "David M. Holmes" wrote:
> > >
> > > Is there a way to spawn a thread from a JSP that will live after
> the page goes out of scope?
> >
> > There is nothing magic about a JSP servlet - you can certainly
> > create objects and start Threads that will continue after
> > the response has been sent.
> >
> > --
> > WBB - [EMAIL PROTECTED]
> > Java Cert mock exams http://www.lanw.com/java/javacert/
> > Author of Java Developer's Guide to Servlets and JSP
> > ISBN 0-7821-2809-2
> > .
> > JSP
> > ISBN 0-7821-2809-2
> > .
> >
>
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Shopping - Thousands of Stores. Millions of Products.
> http://shopping.yahoo.com/
>
>
>
__________________________________________________
Do You Yahoo!?
Yahoo! Shopping - Thousands of Stores. Millions of Products.
http://shopping.yahoo.com/