You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Demetri Mihalakakos <dm...@futurebrand.com> on 2006/11/13 19:34:11 UTC

DBCP is creating active connections on its own, please help

I have DBCP setup and for the most part works fine... But on startup  
of my application/tomcat, active connections are being created and my  
application is not the one creating them or requesting them from the  
pool.  It seems it may be my dbcp setup or something on my server, i  
adjusted my maxActive to infinite and it grabbed over 1000  
connections on startup.

here is a part of my conf file

		 <parameter>
	      <name>maxActive</name>
	      <value>100</value>
	    </parameter>
	
	 	<parameter>
	      <name>maxIdle</name>
	      <value>40</value>
	    </parameter>
	    <!-- Maximum number of idle dB connections to retain in pool.
	         Set to 0 for no limit.
	         -->
	    <parameter>
	      <name>minIdle</name>
	      <value>20</value>
	    </parameter>
	
		<parameter>
			<name>validationQuery</name>
			<value>select * from site</value>
		</parameter>
		
		<parameter>
			<name>testWhileIdle</name>
			<value>true</value>
		</parameter>
	
	    <!-- Maximum time to wait for a dB connection to become available
	         in ms, in this example 10 seconds. An Exception is thrown if
	         this timeout is exceeded.  Set to -1 to wait indefinitely.
	         -->
	    <parameter>
	      <name>maxWait</name>
	      <value>10000</value>
	    </parameter>
	
	    <parameter>
	      <name>defaultAutoCommit</name>
	      <value>false</value>
	    </parameter>
	
	    <parameter>
	      <name>defaultTransactionIsolation</name>
	      <value>REPEATABLE_READ</value>
	    </parameter>
	
	    <!-- Recover abandoned connections -->
	    <parameter>
	      <name>removeAbandoned</name>
	      <value>true</value>
	    </parameter>
	
	    <!-- Set the number of seconds a dB connection has been idle
	         before it is considered abandoned.
              -->
	    <parameter>
	      <name>removeAbandonedTimeout</name>
	      <value>300</value>
	    </parameter>

	    <!-- Log a stack trace of the code which abandoned the dB
                  connection resources.
              -->
	    <parameter>
	      <name>logAbandoned</name>
	      <value>true</value>
	    </parameter>
	
	     <parameter>
	      <name>timeBetweenEvictionRunsMillis</name>
	      <value>60000</value>
	    </parameter>
	
	     <parameter>
	      <name>numTestsPerEvictionRun</name>
	      <value>3</value>
	    </parameter>
   		
   		<parameter>
	      <name>minEvictableIdleTimeMillis</name>
	      <value>600000</value>
	    </parameter>

its very bazaar and i cant seem to figure it out.
if any one can help me out that would be great.
Demetri
	






Re: DBCP is creating active connections on its own, please help

Posted by Sandy McArthur <sa...@apache.org>.
On 11/13/06, Demetri Mihalakakos <dm...@futurebrand.com> wrote:
> here is a part of my conf file
[...]
>                 <parameter>
>                         <name>validationQuery</name>
>                         <value>select * from site</value>
>                 </parameter>

I'm not real familiar but if this fails then I'd guess DBCP would
discard the connection and try to make another to enforce that minIdle
you have set. I'd start with making sure that parameter works as
expected and see where that takes me.

-- 
Sandy McArthur

"He who dares not offend cannot be honest."
- Thomas Paine

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