tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gary Murphy <...@hilbertinc.com>
Subject Re: Problems with connection
Date Mon, 05 Jun 2000 15:09:20 GMT

It sounds like a race condition.   Every servlet is a multithreaded application
since Tomcat will service simultaneous requests on multiple threads within the
servlet engine.  If your code doesn't properly serialize access to objects that
persist across HTTP requests,  you will create a race condition.

This can also happen if your try to store references in the servlet to objects
that have a lifecycle that lasts for the request/response.  For example, if you
have local variables in your servlet to the HttpServletRequest object, you have
a guaranteed problem.


Higgins William wrote:

>         I have been using Jakarta-tomcat for a little over a month.  I
> currently use tomcat-apache to display java servlets built to attach to an
> MS '97 database residing on the computer.  Up until last week that every
> tomcat seemed to work ok but I was still having some problems with multiple
> connections through my servlets.  For example I would call 2 different
> servlets that accessed the database and would receive a null pointer error
> in one browser and in the 2nd window tomcat would display the 1st window's
> request correctly with the 2nd windows address in the bar.
>         In my effort to solve this problem, I tried many things from
> changing my servlet code to changing properties in the database and odbc
> control panel.  When I did this, tomcat stopped working correctly.  By that
> I mean when I requested something from the tomcat server after completing
> the request it would shut down.
>         Not being able to do anything about it, I deleted the Tomcat server,
> odbc drivers and took access off the machine.  Now have reinstalled
> everything.
>         At this point I have the tomcat server running (without apache) and
> am able to access the sample servlets several times in a sequence.  However,
> when I run my own servlets, I get the results completely from 1 servlet and
> then the tomcat server shuts down with the following error dialog box.
>
>         A network error occurred while Netscape was receiving data.
>         (Network Error:  Connection reset by peer)
>         Try connecting again.
>
> If you have seen this error or have any questions please contact me at my
> email address.  This is very important and time critical.  Thanks for your
> help
>
> William Bryan Higgins
> Litton PRC
> Office:  703.556.1867
> Cell:   703.863.8846
> Email:  higgins_william@prc.com
>
> --------------------------------------------------------------------------
> To unsubscribe, email: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commmands, email: tomcat-user-help@jakarta.apache.org

--
Gary Murphy
Hilbert Computing, Inc.
13632 S. Sycamore Dr.
Olathe, KS 66062
913-780-5051



Mime
View raw message