nlight-jdev / jcouchdb

Automatically exported from code.google.com/p/jcouchdb
Other
0 stars 0 forks source link

Need to manually release httpclient connections with the MultiThreadedHttpConnectionManager in ServerImpl.java #5

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
See here:  http://hc.apache.org/httpclient-3.x/threading.html

MultiThreadedHttpConnectionManager connectionManager = new 
MultiThreadedHttpConnectionManager();
HttpClient client = new HttpClient(connectionManager);
        ...
// and then from inside some thread executing a method
GetMethod get = new GetMethod("http://httpcomponents.apache.org/");
try {
    client.executeMethod(get);
    // print response to stdout
    System.out.println(get.getResponseBodyAsStream());
} finally {
    // be sure the connection is released back to the connection 
    // manager
    get.releaseConnection();
}

Original issue reported on code.google.com by timunder...@gmail.com on 23 Jan 2009 at 4:25

GoogleCodeExporter commented 8 years ago
Here's a diff: 
http://github.com/tpunder/jcouchdb/commit/640622cc14c3d4834d25534f4cb9d7764006e5
b9

I've also attached a patch.

Original comment by timunder...@gmail.com on 23 Jan 2009 at 5:20

Attachments:

GoogleCodeExporter commented 8 years ago
I've committed the patch in rev 99.

Original comment by ff...@gmx.de on 29 Jan 2009 at 9:44

GoogleCodeExporter commented 8 years ago
Thanks for your contribution. 

Original comment by ff...@gmx.de on 29 Jan 2009 at 9:45