You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by kunal ashar <ka...@yahoo.co.uk> on 2005/11/07 18:53:06 UTC

disable the connection persistence

Hi
 
To disable the connection persistence can I override the releaseConnection() method and close the connection immediately?
 
For example
 
 public class MyHTTPConnectionManager extends SimpleHttpConnectionManager{
 
 public MyHTTPConnectionManager() {
    super();
     }
  
  public void releaseConnection(HttpConnection conn) {
    super.releaseConnection(conn);
    conn.close();
  }
 }
 
If I am not wrong, in case of SimpleHttpConnectionManager  we are not using any connection pool, if that is the case why persistence connection is used in case of SimpleHttpConnectionManager ? 
 
Thanks
Ashar


		
---------------------------------
Yahoo! Messenger  NEW - crystal clear PC to PC calling worldwide with voicemail 

Re: disable the connection persistence

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Mon, 2005-11-07 at 17:53 +0000, kunal ashar wrote:
> Hi
>  
> To disable the connection persistence can I override the releaseConnection() method and close the connection immediately?
>  

This is exactly what you should be doing

> For example
>  
>  public class MyHTTPConnectionManager extends SimpleHttpConnectionManager{
>  
>  public MyHTTPConnectionManager() {
>     super();
>      }
>   
>   public void releaseConnection(HttpConnection conn) {
>     super.releaseConnection(conn);
>     conn.close();
>   }
>  }
>  
> If I am not wrong, in case of SimpleHttpConnectionManager  we are not using any connection pool, if that is the case why persistence connection is used in case of SimpleHttpConnectionManager ? 
>  

Because connection persistence results in a noticeable performance
improvement and there are enough applications out there that are
intended to communicate with just one host or one host at a time. 

Oleg

> Thanks
> Ashar
> 
> 
> 		
> ---------------------------------
> Yahoo! Messenger  NEW - crystal clear PC to PC calling worldwide with voicemail 


---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-dev-help@jakarta.apache.org