Hi Tom,

HttpClient is not a J2EE application nor an EJB.
If you use it from an EJB, initialization and cleanup
is your responsibility. The only one on this mailing
list that knows what your EJB code is doing is you.

I *suspect* that your EJB creates a new HttpClient
object on redeployment, and more importantly a
new MultiThreadedConnectionManager. The new
connection manager will create it's own connections
to manage, and knows nothing about the old one.
The connections in the old connection manager
will probably not be cleaned up until the old EJB
gets garbage collected.

hope that helps,
  Roland




"Tom Zaranek" <[EMAIL PROTECTED]> 
11.10.2005 22:57
Please respond to
"HttpClient User Discussion"


To
<[email protected]>
cc

Subject
[HttpClient] Number of open sockets increase on session bean redeployment






I am using the MultiThreadedHttpConnectionManager, reuse HttpClient and
do a releaseConnection() on POST method complete on finally in a
try-catch-finally block from within a stateless session EJB.  When
reading the response sent by the post method, I
getResponseBodyAsString(). 

It appears that the number of sockets opens up to the
MAX_SOCKETS_PER_HOST_CONNECTIONS given high enough load.  When I
redeploy the application (ear file), however, the sockets stay open and
additional MAX_SOCKETS_PER_HOST_CONNECTIONS will be created under the
same load.  If the application server gets restarted, all of the socket
connections will be dropped.  Note that the connections initially opened
should stay open since they are set to persist.  But on redeployment I
would expect that the previously opened sockets would close. 

Can someone explain/give a solution to stop the increase of the number
of sockets after each redeployment?  It almost appears that the
Connection Manager does not get destroyed on application redepolyment
which I wonder that it makes sense.
Any help would be appreciated.

Tom

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to