[ 
https://issues.apache.org/jira/browse/AXIS2-4751?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12883412#action_12883412
 ] 

Jarek Gawor commented on AXIS2-4751:
------------------------------------

Glen,

I read those pages before and I think they are misleading. If all requests use 
the same configuration then yes reusing HttpClient instance makes sense. But if 
each request can have different settings (e.g. HTTP 1.0 vs. HTTP 1.1, different 
socket timeouts, cookies, etc.) then reusing HttpClient does not work. And 
that's what is done in the AbstractHTTPSender. Anytime there is a call to 
httpClient.getParams() to set some option that is a potential problem from 
thread safety point of view since we can't know what actual parameters will be 
used for a given call. 
To deal with HttpState, yes we can pass a new instance of it on each 
httpClient.executeMethod() but that still won't address the HttpParams issue.
There is nothing special about HttpClient. It doesn't do any special 
multi-threaded connection management. It's just a simple wrapper that makes 
making multiple http calls using the same configuration a bit easier. Just take 
a look at the source code: 
http://svn.apache.org/viewvc/httpcomponents/oac.hc3x/tags/HTTPCLIENT_3_1/src/java/org/apache/commons/httpclient/HttpClient.java?view=markup

>From my POV creating new HttpClient instances is a little bit easier since we 
>don't have to worry about thread-safety at all. But if we want to reuse 
>HttpClient instances we have to make sure (by rewriting some code) that 
>setting one parameter on one thread does not affect a request on another 
>thread.




> Cookie value is always kept whatever SESSION_MAINTAIN_PROPERTY value is 
> configured
> ----------------------------------------------------------------------------------
>
>                 Key: AXIS2-4751
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4751
>             Project: Axis2
>          Issue Type: Bug
>          Components: transports
>    Affects Versions: 1.5.1
>            Reporter: Ivan
>            Assignee: Jarek Gawor
>         Attachments: Axis2-475.patch
>
>
> Cookie value is always kept whatever SESSION_MAINTAIN_PROPERTY value is 
> configured

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to