You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Nitin Dubey <nd...@imcindia.net> on 2005/11/23 15:08:20 UTC

DBCP Idle Connections Problem - Msg Updated

Hello,

I have configured DBCP with Spring Framework in one of our applications.
The time DBCP takes to return a connection is unpredictable.  Sometimes it
gets the connection instantly and sometimes it takes 40-60 seconds.  The
statement that is causing the delay is dataSource.getConnection();

When the application is not used for say 30 mins then the first request
after that will be slow.  All the requests after that will be served fast.

Has anyone faced this kind of problem ?  Let me know how should I go ahead.
Following are the parameters I pass to DBCP.

	<bean id="oracleDataSource" class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close">
		<property name="driverClassName">
 			<value>oracle.jdbc.driver.OracleDriver</value>
		</property>
		<property name="url">
  			<value>jdbc:oracle:thin:@99.99.99.99:1521:ABC</value>-->
		</property>
		<property name="username">
			<value>username</value>
		</property>
		<property name="password">
			<value>password</value>
		</property>
		<property name="initialSize">
			<value>5</value>
		</property>
		<property name="maxActive">
			<value>10</value>
		</property>
		<property name="maxIdle">
			<value>5</value>
		</property>
		<property name="maxWait">
			<value>10000</value>
		</property>
		<property name="validationQuery">
			<value>SELECT 1 from dual</value>
		</property>
		<property name="testOnBorrow">
			<value>true</value>
		</property>
		<property name="testWhileIdle">
			<value>true</value>
		</property>
	</bean>

Cheers,

- nitin


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