Like Rickard, we also have started to call release() in a finally
block for client and clientresource code, since it seemed, according
to previous posts, that that was a necessary best practice, especially
when using the Httpclient4 extension, where we'd seen situations where
threads weren't getting released properly.  So, it'd be great to see
an official client-code best practice example that includes calls to
exhaust() and release().

-Dave

On Thu, Dec 30, 2010 at 1:45 AM, Rickard Öberg <[email protected]> wrote:
> On 2010-12-30 07.34, Jerome Louvel wrote:
>> Hi Marc,
>>
>> I don't know if you still experiment issues with this, but here are a couple 
>> of clarifications:
>>
>> 1) release() has the effect of closing the underlying TCP socket, preventing 
>> persistent connection reuse. So it can't be recommended to systematically 
>> call it.
>>
>> 2) exhaust() does ensure a proper consumption of the entity and enable reuse 
>> of the connection. If you don't systematically consume the entity via other 
>> means (actually reading it), then calling exhaust() is the way to go.
>
> Is there any difference between best practices of how a client vs a
> server should handle this? Right now we have our clients do
> response.release() in a finally block. Does your response imply that
> this messes up persistent connections from the clients point of view?
>
> /Rickard
>
> ------------------------------------------------------
> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2694744
>

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2695029

Reply via email to