tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adam Hardy <ahardy.str...@cyberspaceroad.com>
Subject Re: Datasource connections not released when reloading context
Date Fri, 03 Oct 2003 07:21:31 GMT
Sorry, but I didn't see which datasource you were using. With DBCP, you 
have these optional parameters:

  <!--  abandoned dB connections are removed and recycled -->
  <parameter>
   <name>removeAbandoned</name>
   <value>true</value>
  </parameter>
  <!-- set the number of seconds a dB connection has been idle before
       it is considered abandoned. default timeout is 300 seconds.-->
  <parameter>
   <name>removeAbandonedTimeout</name>
   <value>60</value>
  </parameter>
  <!-- 'logAbandoned' can be set to true if you want DBCP to log a
       stack trace of the code which abandoned connections.-->
  <parameter>
   <name>logAbandoned</name>
   <value>true</value>
  </parameter>

I think if you set the timeout to 1 or 2, then you may see a stacktrace 
from abandoned connections.

I'd be interested to see if it works,
Adam


On 10/03/2003 12:30 AM Jose Alfonso Martinez wrote:
> On Wed, Oct 01, 2003 at 11:37:39AM -0500, Matt Raible wrote:
> 
>>I already do this, but when I "reload" my context, I get two database
>>connections, rather than one.  So each time I reload, I get an additional
>>connection - eventually resulting in an OutOfMemory Error (which I'm
>>attributing to this) after I reload 10-20 times.
>>
> 
> 
> That is what I was talking about. I have that problem. I close connections after each
access but when I reload my context I guess a new datasource is created, therefore oppening
new connections. After many reloads the database max limit of connections is reached...
> 
> Does any one have an idea of what may be going on??? May be it could be that I do not
nullify the datasource in some destroy() method but I am not sure...
> 
> Jose
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 
> 

-- 
struts 1.1 + tomcat 5.0.12 + java 1.4.2
Linux 2.4.20 RH9


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message