tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Multi-user problem (after some suggestions)
Date Mon, 11 Feb 2002 21:50:23 GMT
This is a bit of a repost, having followed some suggestions from my last post.

I haven't yet found a solution to my problem.  Most of you suggested that I replace my jdbc-odbc
bridge driver with a better jdbc driver.  I've since replaced it with the Microsoft SQL Server
jdbc beta 2 driver.  The behavior has not changed.  A few of you asked about my connection
object and its scope and lifecycle, etc.  Below is a snipped copy of my original message,
plus some code I'm using that partains to the database part..

If anyone wants more detail than this, I can combine and repost my last two messages.

    public void doPost(HttpServletRequest request, HttpServletResponse response)
    throws IOException, ServletException

        //Various variable declarations omitted here

        //Database stuff
        Connection con;
        Statement query;
        ResultSet rs;

        PrintWriter out = response.getWriter();

        //Get userid and password.  Abort if not provided.

        String ts;
        Enumeration en=request.getParameterNames();
        while (en.hasMoreElements()) {
        ts=(String) en.nextElement();
        System.err.println(ts+" = "+request.getParameter(ts));

        //Open JDBC Connection
            //Old driver for jdbc/odbc bridge
            //con = DriverManager.getConnection("jdbc:odbc:sqaa","sa","");

            //Use the spiffy new Microsoft SQL2k jdbc beta 2 driver
            con = DriverManager.getConnection("jdbc:microsoft:sqlserver://;DatabaseName=sqaa;user=sa");
            query = con.createStatement();
        catch (Exception exc) {
            System.err.println("Error creating JDBC connection.");
        } wrote:

>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?
REPHRASED:  When the problem occurs, it seems that Apache doesn't pass the parameters (the
name/value pairs that would be in the URL for a GET request) to tomcat, or so says my debug

>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
>NEXTIMAGE is called repeatedly (say 1000 to 3000 times per workshift per user).  

..Omitted old database info here ...

The user first sees a plain html document with a login form.  We never have problems with
this document.  After submission, the user goes to a report page (the LOGIN servlet) which
contains another form (just a submit button).  This page uses a database connection to generate
the report.  The submit button loads the NEXTIMAGE servlet.  The nextimage servlet is called
thousands of times after that.  A button on its output page calls itself iteratively.
Problems may occur if two simultaneous calls to NEXTIMAGE are made, or if simultaneous calls
are made to LOGIN and NEXTIMAGE.
I'm not using connection pooling yet since there are only two users.  I may later, but not
until this is fixed (unless it's the solution).  KISS, afterall :)

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