The bug report was posted on Sun's site
(http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6495923) and has the
following evaluation comment:
"The description is not accurate. HttpURLConnection does support
persistent connections. By default it maintains an internal cache of
connections, allowing it to reuse the same connection for multiple
requests to the same host/proxy. There is no requirement for the
HttpURLConnection instance to be the same. The cache is static and is
across all HttpURLConnections.
To take advantage of this feature couldn't be easier, simply read the
data off the InputStream and close it when finished. It is the close
action that will try to put the actual underlying connection into the
"keep alive" cache.
see:
http://java.sun.com/j2se/1.5.0/docs/guide/net/http-keepalive.html
http://blogs.sun.com/chegar/entry/http_keep_alive_improvements
"
Any thought?
Best,
Jerome
Jerome Louvel :
Hi John,
I've reported the issue with connection reuse in JDK's HttpUrlConnection
class and suggested that they add a transparent reuse mechanism similar
to Apache HTTP Client.
The bug report was accepted and will show at this URL in a couple of
days: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6495923
Best regards,
Jerome