Thanks Roland


Using different HttpClient objects for each user is a waste of resources.
Cookies are not stored in the HttpClient object, but in an HttpState
object. Keep different HttpState objects for each user and pass them
to a single HttpClient object when executing methods, instead of using
the default state of different HttpClient objects.


In this case I would have to synchrozize this block of code

synchronized(foo) {
  httpClient.setState(getStateForThisUser());
  HttpMethod getMethod = new HttpMethod();
  client.executeMethod(getMethod);
  saveStateForThisUser(httpClient.getState())
}

It seems to me I will have to synchronize until the method is complete and
the state in HttpClient updated which is quite a bottleneck. Or am I missing
something?

Many thanks,
David

Reply via email to