commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nitin Dubey" <ndu...@imcindia.net>
Subject DBCP Idle Connections Problem
Date Wed, 23 Nov 2005 14:02:56 GMT
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="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


Mime
View raw message