tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Multi-user problem
Date Wed, 06 Feb 2002 23:23:23 GMT
I developed a system for reviewing scanned image quality.
The system worked like a champ during development and on launch day.
The next day, we went from 1 user to 2.
The system is 100% intolerant of simultaneous requests.
Anytime the second user makes a request before the first user's request is fulfilled, output
stops and both requests are not fulfilled; The system is 'hung'.  
Restarting Apache HTTP server resumes normal operation.
The situation is easily reproducable.  Any ideas?

Note: After looking at my pseudo-code at the bottom, it may help to know that occasionally
when this happens, 
my servlet outputs this error to the Tomcat Console window:
'Login Parameters not found'

Since I'm using post requests, I cannot see the parameters, but this error indicates that
the parameters are 
incompletely sent or not sent at all when this occurs.  
And it's not just the parameters, but the whole request to Tomcat, and maybe its response.
When login parameters are not sent, the servlet will show a "bad login" page.  It doesn't
happen in this case.

My best conclusion is that when this NEXTIMAGE servlet is run twice at once, it causes Apache
to stop talking to tomcat properly.

Apache 1.3 is a service on Windows 2000 running Tomcat 4 on the same server, with SQL server
2000 SP1 on the same server.  
My system has 2 servlets, AUDREPORT and NEXTIMAGE.  AUDREPORT is run once per user at login.
NEXTIMAGE is called repeatedly (say 1000 to 3000 times per workshift per user).
Database connections are made through ODBC with the JDBC:ODBC:DSN bridge using the sun.jdbc.odbc.JdbcOdbcDriver
driver.  I used a SYSTEM DSN.
If it makes any difference, The machine has MDAC 2.6 SP1, BDE 5.1, Winzip 8, Pegasus ImagN'
4.0 imaging components, 
a Custom Delphi 6 database app and VNC installed on it and is logged in as Administrator.

I'm not at home with Apache error log entries, but I see a lot of these:
(of the following, I think packet 6 errors are most prevalent):
Invalid Packet 2 followed by numerous 'communitcation interrupted' messages, between 1 and
10 of them, all within one second.
Invalid Packet 6 followed by numerous 'communitcation interrupted' messages, between 1 and
10 of them, all within one second.
Invalid Packet 200 followed by numerous 'communitcation interrupted' messages, same as above..

forcing termination of child #0 (handle 520)    //( <-- this handle is always 520 and always
child #0.)

It's worth noting that NONE of the above errors occurred on launch day (when I was sure there
was only 1 user).

The users follow this work flow:

1) Enter name/password at Login page (which is plain HTML with a form that is directed to
servlet AUDREPORT.

2) A report is generated, reflecting how many images are total, done, and undone.  On the
page is a submit button which calls servlet NEXTIMAGE.

3) NEXTIMAGE generates a page with an image and some checkboxes on a form which is redirected
to the NEXTIMAGE servlet.  
So, 99% of the time, all users are accessing the same servlet.

4) The loop is broken when the user has viewed the last available image, and the users are
sent back to the login page.

Workers are viewing images from the same pool, and obviously both call the same servlet on
the same server repeatedly.  So, nextimage is the servlet that is running when the problem

The NEXTIMAGE servlet looks something like this pseudo-code:
public static void login(...){ Tell database user is logged in. }
public static void logout(...) {Tell database user is logged out.}
public static void updateaccesstime(...) {Tell Database I made a request}
public void doPost(HttpServletRequest request, HttpServletResponse response) {
if lastaccess was too long ago {logout; return;}
if (userid is present and password is present) {
  if (userid/password is in database) { updateaccesstime(userid,password) }
  else { System.err.println('Login Parameters not found'); Send badloginpage to client; return;}

if (submit_action=="logout") logout;
if (submit_action="get image") {
Get details about previous image (if any) from request.getParameters(...) and update database
with the info.
{ //Get next image
Get the name of the next available image and reserve it.
// Generate HTML for Image Evaluation page, placing image name in parameters of ActiveX image
control embedded in the page.
// This HTML is generated by the following:
Vector ssi = new Vector();
// ssi vector is fed to a thelper class method which opens a file and does a 
// "search and replace on it" in a vector,
// then feeds the vector one line at a time to the httpresponse writer.
thelper.ssiserv(String htmldocumentfilename, Vector ssivector)



Your favorite stores, helpful shopping tools and great gift ideas. Experience the convenience
of buying online with Shop@Netscape!

Get your own FREE, personal Netscape Mail account today at

To unsubscribe:   <>
For additional commands: <>
Troubles with the list: <>

View raw message