I probably do not know the breadth of implementations folks have used to address this, 
but here are a couple of thoughts.

1. If the service is given a scope of "session" in the deployment descriptor, then an 
instance of the service class is created for each session that uses it.  It will be 
freed along with other session resources by the container when the session is 
terminated.  Thus, if one uses, say, a new database connection for each session, that 
connection is freed as well, assuming it is in an instance variable of the class.

2. Rather than create resources per-session, pool them and get/release for each method 
invocation.  This is what I tend to do.  Containers and/or JDBC 2.0 implementations 
help with this for database connections.

Scott Nichol

Do not send e-mail directly to this e-mail address,
because it is filtered to accept only mail from
specific mail lists.
----- Original Message ----- 
From: "Joan Pont" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, December 01, 2003 1:08 PM
Subject: RE: Urgent: How to know when a Session has been terminated within Apache SOAP


> Thanks Scott,
> Then, there is absolutely no way to free session allocated resources
> in Apache SOAP? 
> I thought that, for example, releasing a backend database connection
> when the session-enabled client connection drops would be a very common
> problem. 
> How do people get around this issue?
>       Do they have to implement some sort of inactivity timers on the
> backend connections/allocated resources?
> 
> Thanks!
> Joan.
> 
> 
> -----Original Message-----
> From: Scott Nichol [mailto:[EMAIL PROTECTED] 
> Sent: 28 November 2003 19:07
> To: [EMAIL PROTECTED]
> Subject: Re: Urgent: How to know when a Session has been terminated within
> Apache SOAP
> 
> You are not notified from within SOAP code when a session ends.
> 
> Scott Nichol
> 
> Do not send e-mail directly to this e-mail address,
> because it is filtered to accept only mail from
> specific mail lists.
> ----- Original Message ----- 
> From: "Joan Pont" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Friday, November 28, 2003 12:06 PM
> Subject: Urgent: How to know when a Session has been terminated within
> Apache SOAP
> 
> 
> > Hi,
> > I would really appreciate any help/suggestions regarding this issue.
> > I have a problem regarding allocation/reallocation of resources per
> > session. 
> > The idea is that some resources are allocated to be able to service
> > a session enabled client when we receive the first request. Those
> resources
> > must be deallocated when the session terminates.
> >        I need to know/be notified when the HTTP session has been
> terminated
> > within the SOAP code.
> > Does SOAP know when the HTTP session has been terminated? 
> > For example the client connection has dropped and effectively the
> > Tomcat knows that this session is not active anymore. Can I get notified
> of
> > that event within Apache SOAP?
> > Is there way so I can free session allocated resources when a
> > session terminates?
> > Is there for example a session listener interface that can be
> > implemented?
> > 
> > Many thanks,
> > Joan.
> > 
> > 
>

Reply via email to