tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gilmor...@netscape.net
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;


        response.setContentType("text/html");
        PrintWriter out = response.getWriter();

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

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



        //Open JDBC Connection
        try{
            //Old driver for jdbc/odbc bridge
            //Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
            //con = DriverManager.getConnection("jdbc:odbc:sqaa","sa","");

            //Use the spiffy new Microsoft SQL2k jdbc beta 2 driver
            Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
            con = DriverManager.getConnection("jdbc:microsoft:sqlserver://172.29.6.12:1433;DatabaseName=sqaa;user=sa");
            query = con.createStatement();
        }
        catch (Exception exc) {
            System.err.println("Error creating JDBC connection.");
            System.err.println(exc.getClass().getName());
            System.err.println(exc.getMessage());
            thelper.fileServe(out,"c:/html/except.html");
            return;
        }


gilmoresp@netscape.net 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
data..


>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).  

..Omitted old database info here ...

REPHRASED:
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! http://shopnow.netscape.com/

Get your own FREE, personal Netscape Mail account today at http://webmail.netscape.com/


--
To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>


Mime
View raw message