tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Re: Interrupting tomcat threads.
Date Fri, 20 Jul 2007 15:01:32 GMT
However, even then, you may find that the requests are not as asynchronous 
as you'd like.  If the two HTTP requests underlying the AJAX requests 
happen to be sent over the same HTTP connection, then the HTTP protocol 
dictates that the responses must be returned in the same order, i.e. the 
response for request 2 cannot be returned, until the response for request 
1 has been returned.  If the two HTTP requests happen to be sent over 
separate HTTP connections, you will get the desired behavior.  While 
guidelines indicate 1-4 concurrent connections may be used by a client, 
most browsers will try to minimize the use of separate connections, and 
pipeline some of the requests. 
The bottom line is that you may, or may not, get the asynchronous behavior 
you seek, depending on decisions made within the browser under a given set 
of circumstances.

Please respond to "Tomcat Users List" <>

To:     Tomcat Users List <>
cc:     keif <> 
Subject:        Re: Interrupting tomcat threads.

On Fri Jul 20 15:23:45 CEST 2007 Tomcat Users List 
<> wrote:
> Christopher Schultz-2 wrote:
> >
> > So, multiple simultaneous AJAX requests are considered illegal?
> >
> Exactly. All requests that modify the session state will be 
> Christopher Schultz-2 wrote:
> >
> > I would also recommend vetoing the /second/ request, rather than
> > canceling the first request when a second one comes in.
> >
> Well, once the requests are synchronized, I'd like to give users an 
> to change their mind and not wait until the first request finishes. That 
> the main justification for interrupting threads. It will allow for a 
> responsive interaction with the UI. There is an article with a good 
> of request synchronization:
> Hope it's clear now why I'm asking about interrupting threads - vetoing 
> second request would make the user wait for the first one to complete.
The requests aren't synchronized.
Only updating the session is synchronized.
So, you can make multiple ajax requests to servlets if the browser 
supports it.


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message