On 16 February 2011 10:41, Maxim Veksler <[email protected]> wrote:
> On Tue, Feb 15, 2011 at 3:06 PM, Oleg Kalnichevski <[email protected]> wrote:
>>
>> Well, I finally spotted an obvious problem with your code, which I
>> should have found earlier: HttpRequest objects are NOT thread-safe. They
>> may not be used by multiple threads.
>>
>> Oleg
>>
>
> Hi Oleg,
>
> By HttpRequest you mean HttpClient?

No, I'm pretty sure he means HttpRequest.

> If so then I believe it's a documentation bug because the code is
> mostly based on this sample:
> http://hc.apache.org/httpcomponents-client-ga/tutorial/html/connmgmt.html#d4e650.
> Also it's perhaps wise to document that fact that the class is not
> thread safe in the javadoc's.
>
> I've shared my test code https://gist.github.com/829061, could you
> perhaps run it on your machine? It's and eclipse project with
> m2eclipse support configured.
>
> As for the code, I've made the modifications but the behavior remains:

The code still shares a single HttpGet instance.

Please fix that and try again.

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

Reply via email to