Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Tomcat , filter and persistent connections

Reply
Thread Tools

Tomcat , filter and persistent connections

 
 
pvsnmp@yahoo.com
Guest
Posts: n/a
 
      12-03-2005
Hi,
What will happen in the following scenario, A client establishes
HTTP/1.1 persistent connection with Tomcat. The web application to
which the request is destined has a filter configured .
The client sends multiple requests over the same socket connection to
Tomcat server. Will tomcat invoke the doFilter() method of the filter
code multiple times for the different requests or will the Filter code
also get the requests in a pipelined fashion?

Another question is , a client sends a request to Tomcat, and the
requested application has a filter configured for it, When the filter
code is being executed if the client disconnects the connection to
Tomcat , what will happen to the execution of filter code, will it
stop?

rgds,
Prashant

 
Reply With Quote
 
 
 
 
jesper.matthiesen@gmail.com
Guest
Posts: n/a
 
      12-03-2005

wrote:
> Hi,
> What will happen in the following scenario, A client establishes
> HTTP/1.1 persistent connection with Tomcat. The web application to
> which the request is destined has a filter configured .
> The client sends multiple requests over the same socket connection to
> Tomcat server. Will tomcat invoke the doFilter() method of the filter
> code multiple times for the different requests or will the Filter code
> also get the requests in a pipelined fashion?
>
> Another question is , a client sends a request to Tomcat, and the
> requested application has a filter configured for it, When the filter
> code is being executed if the client disconnects the connection to
> Tomcat , what will happen to the execution of filter code, will it
> stop?
>
> rgds,
> Prashant


 
Reply With Quote
 
 
 
 
Chris Smith
Guest
Posts: n/a
 
      12-03-2005
<> wrote:
> What will happen in the following scenario, A client establishes
> HTTP/1.1 persistent connection with Tomcat. The web application to
> which the request is destined has a filter configured .
> The client sends multiple requests over the same socket connection to
> Tomcat server. Will tomcat invoke the doFilter() method of the filter
> code multiple times for the different requests or will the Filter code
> also get the requests in a pipelined fashion?


The HTTP transport level is irrelevant in the behavior of a servlet
container with respect to servlets. Therefore, the Filter will be
invoked and complete separately for each request. Because the requests
are serialized on one connection, you do get the guarantee that each one
will complete before the next one. However, you really shouldn't design
for this condition.

> Another question is , a client sends a request to Tomcat, and the
> requested application has a filter configured for it, When the filter
> code is being executed if the client disconnects the connection to
> Tomcat , what will happen to the execution of filter code, will it
> stop?


What will typically happen (filter or not) is that an IOException will
be thrown on the next attempt to read from or write to the underlying
request/response streams.

--
www.designacourse.com
The Easiest Way To Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
 
Reply With Quote
 
pvsnmp@yahoo.com
Guest
Posts: n/a
 
      12-03-2005
>What will typically happen (filter or not) is that an IOException will
>be thrown on the next attempt to read from or write to the underlying
>request/response streams.
>Chris Smith - Lead Software Developer/Technical Trainer
>MindIQ Corporation


Hi,
Thanks very much for the explanation

rgds,
Prashant

 
Reply With Quote
 
Chris Smith
Guest
Posts: n/a
 
      12-03-2005
<> wrote:
> >What will typically happen (filter or not) is that an IOException will
> >be thrown on the next attempt to read from or write to the underlying
> >request/response streams.


> Thanks very much for the explanation


I'm afraid I was a little inaccurate, though. Let me expand. The
IOException will be thrown on the next attempt to read from or write to
the underlying sockets. That may or may not be the next attempt to
read/write the streams. If the streams are buffered, then the exception
may occur at any point in the future.

If you don't mind committing the response and you have some special
reason that a disconnect may have occurred such as after a long delay,
you could just flush the output stream to be sure.

--
www.designacourse.com
The Easiest Way To Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Persistent field and Persistent properties - difference gk Java 7 10-12-2010 09:43 PM
Lingering Idle Oracle Connections? Persistent connections? jobs ASP .Net 2 11-16-2007 03:37 AM
HTTP Persistent Connections using SonicMQ (and Sonic ESB) WVJohnSMith@yahoo.com Java 0 08-23-2006 08:53 PM
ASP.net Debugger and Persistent Connections =?Utf-8?B?bWFuamk=?= ASP .Net 0 08-04-2005 06:05 AM
Persistent connections possible in ASP.Net? Jim Hubbard ASP .Net 2 01-21-2005 09:10 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57