tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James House <james.ho...@partnet.com>
Subject RE: Problems with connection
Date Mon, 05 Jun 2000 16:22:07 GMT

I'm positive that both Jeff and Gary (in his response) are correct.
- You have a threading problem (race-condition) because Access
is not at all what one would term a "robust" database system.

Although choosing a different RDBMS would be the best long-term
solution, there is an alternative.

You could create a "singleton" type object, that contains a reference
to a SINGLE connection to the Access database.  This object could
contain a method to "hand out" the connection, and a method to
"return" the connection.  These methods could be built to prohibit
two threads from using the connection at once.

If every servlet that uses a connection, goes through this object to
get and return the connection, then you'll have a solution - although
no two servlets would be able to run simultaneously - which means
you'd have a bit of a performance hit - but I'm guessing that's not
a big issue since you're using Access.

If you need more detail about how to implement such an object,
let me know, I'd be happy to elaborate.

James

>Sir,
>
>I believe the issue is the ODBC driver for Access is not thread-safe.  You
>might consider migrating to a more traditional server environment, such as
>PostgreSQL, MySQL, or (dare i say it? ;) MSSQL7.  The latter will look much
>more familiar to you, albeit at a greater cost.
>
>Best Regards,
>Jeff Rhines
>
>-----Original Message-----
>From: Higgins William [mailto:Higgins_William@prc.com]
>Sent: Monday, June 05, 2000 10:45 AM
>To: 'tomcat-user@jakarta.apache.org'
>Subject: Problems with connection
>
>
>
>         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
>
>
>
>
>--------------------------------------------------------------------------
>To unsubscribe, email: tomcat-user-unsubscribe@jakarta.apache.org
>For additional commmands, email: tomcat-user-help@jakarta.apache.org


Mime
View raw message