Edit Edit

Java Servlet FAQ


Why do I get an error when two users concurrently access a servlet that reads from a Microsoft Access database?


When two or more clients send a request to the servlet at the same time, a separate thread is used to process each request. This means that the two threads could be trying to read from the Microsoft Access database simultaneously. This is not allowed by Microsoft Access so you get a database error. To fix this problem, you need to use the "synchronized" keyword to synchronize your database access code so that only one thread accesses the database at a time.



Last updated 12/19/1999 09:56:18 PM