No, I am not saying that. I am saying that the connections, being returned to the pool on connection.close(), remain open as long as they are not garbage. When a context is reloaded, the previous context hangs around for a while. That context holds reference(s) to the pool, which in turn holds reference(s) to open connections. Once the context is gc'd, then the cascade effect is to close the connections.
Bouncing the entire tomcat server will always close all the connections, because all contexts are shut down and garbage collected. Tim P.s. See this: http://marc.theaimsgroup.com/?l=tomcat-user&m=114001512903342&w=2 (which still has no answer, BTW. Anyone have one? I'd be happy enough to be able to manually shut down the pool on my ServletContextListener.contextDestroyed()) -----Original Message----- From: Edward Quick [mailto:[EMAIL PROTECTED] Sent: Friday, March 10, 2006 7:50 AM To: users@tomcat.apache.org Subject: RE: Tomcat jdbc settings Thanks Tim. I have also noticed that bouncing the tomcat clears the connections. So are you saying java's garbage collection will clear the old connections out? Does this mean my settings below are redundant? Ed. >In my experience, using 8i and the thin driver, bouncing tomcat always >clears all connections to the DB. Reloading the app will not >necessarily clear connections, as the old app is still in PermGen, >waiting for garbage collection. Once collected, however, the connections will get cleaned up. > > > >-----Original Message----- >From: Edward Quick [mailto:[EMAIL PROTECTED] >Sent: Friday, March 10, 2006 3:46 AM >To: users@tomcat.apache.org >Subject: Tomcat jdbc settings > >Hi, > >I have set up Tomcat 4.1.31 with a JDBC pool using the settings below. >However I 'm a bit confused about my the way this works. > >1. InitialSize is set to 5 yet I don't see any connections started >after Tomcat is bounced. >2. Some of the older connections are not getting cleared down. >3. Although maxIdle is set to 5, I still get more than 5 idle connections. > >I have referred to the documentation on: >http://jakarta.apache.org/commons/dbcp/configuration.html > >and tried to set accordingly as below. Could someone with more >experience comment on these please, and recommend any changes I need to make? > >Many thanks, > >Ed. > > <Context path="/POL" docBase="/b7/apache/b7uat08/webapps/POL" >debug="0"> > <Logger className="org.apache.catalina.logger.FileLogger" > prefix="POL." suffix=".log" timestamp="true"/> > > <Resource name="jdbc/pol" auth="Container" >type="javax.sql.DataSource"/> > > <ResourceParams name="jdbc/pol"> > <parameter> > <name>factory</name> > ><value>org.apache.commons.dbcp.BasicDataSourceFactory</value> > </parameter> > <parameter> > <name>username</name> > <value>xxxxxxx</value> > </parameter> > <parameter> > <name>password</name> > <value>xxxxxxx</value> > </parameter> > <parameter> > <name>driverClassName</name> > <value></value> > </parameter> > <parameter> > <name>driverClassName</name> > <value>oracle.jdbc.OracleDriver</value> > </parameter> > <parameter> > <name>url</name> > ><value>jdbc:oracle:thin:@sunlhrd36.abc.com:1538:ZJUPT</value> > </parameter> > <parameter> > <name>maxActive</name> > <value>10</value> > </parameter> > <parameter> > <name>initialSize</name> > <value>5</value> > </parameter> > <parameter> > <name>minIdle</name> > <value>2</value> > </parameter> > <parameter> > <name>maxIdle</name> > <value>5</value> > </parameter> > <parameter> > <name>maxWait</name> > <value>10000</value> > </parameter> > <parameter> > <name>validationQuery</name> > <value>select 1 from dual</value> > </parameter> > <parameter> > <name>testOnBorrow</name> > <value>true</value> > </parameter> > <parameter> > <name>testOnReturn</name> > <value>false</value> > </parameter> > <parameter> > <name>testWhileIdle</name> > <value>true</value> > </parameter> > <parameter> > <name>minEvictableIdleTimeMillis</name> > <value>60000</value> > </parameter> > <parameter> > <name>timeBetweenEvictionRunsMillis</name> > <value>120000</value> > </parameter> > <parameter> > <name>numTestsPerEvictionRun</name> > <value>10</value> > </parameter> > > <parameter> > <name>removeAbandoned</name> > <value>true</value> > </parameter> > <parameter> > <name>removeAbandonedTimeout</name> > <value>5</value> > </parameter> > <parameter> > <name>logAbandoned</name> > <value>true</value> > </parameter> > </ResourceParams> > </Context> > > > >--------------------------------------------------------------------- >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] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]