At 05:02 PM 3/4/99 -0800, jon * wrote:
>> Can someone straighten me out. I thought that with each
>> instance of a connection to an "HttpServlet" lived in
>> a separate thread. When I access the same servlet,
>> if the first one is doing a long query, the other one
>> is stuck waiting until the first is done. What do I have
>> to do avoid this problem? I'd appreciate some guidance. I
>> must be missing something simple as this has to be
>> a very common issue.
>
>Make sure you are not implementing SingleThreadModel.

Another possibility, depending on how you do the queries...
The threads could be running independently, but if the database
(or whatever) only accepts one query at a time, your threads
will have to pass that bottleneck sequentially.

I have a servlet which does exactly this.  I synchronized the
database access method, because our application performs better
this way.  Servlet actions which don't require the database
still get processed promptly without waiting for the long-running
queries.  Of course, for many applications sequential queries
would be unacceptable.

Steve

====================================================================
 Steve Ryan                     http://www.numeriex.com/~ryan/
 Accrue Software, Inc.          http://www.accrue.com/


----------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Archives and Other:  <http://www.working-dogs.com/>
Problems?:           [EMAIL PROTECTED]

Reply via email to