On Mon, Aug 29, 2005 at 11:02:25AM +0200, Eric Portalez wrote:
> It is exactly what I'm saying, Ortwin.
> This explains the origin of my funny code. I belived it was correct.
> Otherwise, is there a mean of getting the current connection, or are we just
> supposed the manage it after the "method.execute()" ?
> 
> Eric Portalez
> 

Eric,

If you want to have a greater control over connection management, you
should implement a custom connection manager. The code you posted below,
will have the desired effect with the simple connection manager that has
just one connection, but is completely meaningless if used with the
pooled connection manager

Oleg

> ----- Original Message ----- 
> From: "Ortwin Gl?ck" <[EMAIL PROTECTED]>
> To: "HttpClient Project" <[email protected]>
> Sent: Monday, August 29, 2005 10:52 AM
> Subject: Re: session not closed tomcat's manager
> 
> 
> Eric,
> 
> Are you saying that code is in Slide?
> This code is complete bollocks in my opinion. It gets a new connection
> from the connection manager and closes it again.
> 
> Ortwin Gl?ck
> 
> Eric Portalez wrote:
> > Hello,
> >
> > I prefere to be sure of well understanding your recommandations.
> > Here is the original code of the closeSession() method, extract from the
> webdav API.
> >
> > public void closeSession()
> >         throws IOException
> >     {
> >         if(client != null)
> >         {
> >
> client.getHttpConnectionManager().getConnection(client.getHostConfiguration(
> )).close();
> >             client = null;
> >         }
> >     }
> >
> > My question is :
> > Does
> "client.getHttpConnectionManager().getConnection(client.getHostConfiguration
> ())" get an existing connection or create a new connection ?
> > And thus, am I supposed not to write this line (with" close()" at the end)
> ?
> >
> > Thanks
> >
> > Eric
> >
> > ----- Original Message ----- 
> > From: "Ortwin Gl?ck" <[EMAIL PROTECTED]>
> > To: "HttpClient Project" <[email protected]>
> > Sent: Friday, August 26, 2005 5:30 PM
> > Subject: Re: session not closed tomcat's manager
> >
> >
> > Eric,
> >
> > this code looks funny - and is completely useless. Remove it.
> > All you have to do is call HttpMethod.releaseConnection.
> >
> > You are trying to destroy a server-side session from the client side.
> > This is simply impossible. Your *webapplication* has to destroy the
> > session with a call to HttpSession.invalidate(). Or you can simply wait
> > until it expires. Default timeout is something like 30 minutes or so.
> > Normally a session is destroyed upon "logout" from the webapp. How that
> > happens is not standardized and depends completely on the concrete
> > implementation.
> >
> > Ortwin Gl?ck
> >
> > Eric Portalez wrote:
> >
> >>Hello,
> >>
> >>I'm trying to terminate properly my session, but I don't manage.
> >>
> >>Here my code :
> >>
> >>public void closeSession() throws IOException{
> >>  if(client != null){
> >>
> client.getHttpConnectionManager().getConnection(client.getHostConfiguration(
> )).setConnectionTimeout(1);
> >>
> client.getHttpConnectionManager().releaseConnection(client.getHttpConnection
> Manager().getConnection(client.getHostConfiguration()));
> >>
> client.getHttpConnectionManager().getConnection(client.getHostConfiguration(
> )).close();
> >>   client.setConnectionTimeout(1);
> >>   client = null;
> >>  }
> >>}
> >>
> >>
> >>I've tried differents combinations without any success. My manager in
> tomcat always shows me that the session is opende.
> >>I precise that my session disapear correctly at the end of the timeout.
> >>
> >>
> >>Any ideas ?
> >>
> >>Thanks.
> >>
> >>
> >>Eric Portalez
> >>
> >>
> >
> >
> 
> -- 
> [web]  http://www.odi.ch/
> [blog] http://www.odi.ch/weblog/
> [pgp]  key 0x81CF3416
>         finger print F2B1 B21F F056 D53E 5D79 A5AF 02BE 70F5 81CF 3416
> 
> ---------------------------------------------------------------------
> 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]
> 
> 

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

Reply via email to