commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Meenakshisundaram, Pattabiraman" <>
Subject RE: [dbcp] Question on Active connections
Date Wed, 03 Nov 2010 14:26:21 GMT

The DBCP configuration for my app is given below:

        <bean id="oracleDs" class="org.apache.commons.dbcp.BasicDataSource">
                <property name="driverClassName" value="${}" />
                <property name="url" value="${}" />
                <property name="username" value="${}" />
                <property name="password" value="${}" />
                <property name="initialSize" value="10"/>
                <property name="maxActive" value="30"/>
                <property name="maxWait" value="1500000"/>
                <property name="poolPreparedStatements" value="false"/>
                <property name="maxOpenPreparedStatements" value="50"/>

I am assuming that there would be Max Active connections of 30 all the time but in the log,
I see that no. of active connections appear to be cyclical. It goes down from 29 to 0 and
then resets to 29. I was assuming that it would stay constant once it reaches Max Active.
Is it not the way it works?

In the log I am printing Active and Idle connections
 Active-> 0 Idle-> 8
 Active-> 0 Idle-> 8
 Active-> 0 Idle-> 8
 Active-> 0 Idle-> 8
 Active-> 0 Idle-> 8
 Active-> 16 Idle-> 0
 Active-> 29 Idle-> 1
 Active-> 28 Idle-> 1
 Active-> 29 Idle-> 1
Active-> 29 Idle-> 1
 Active-> 29 Idle-> 1

Note: I am tweaking these properties with the hope that this would fix a problem we are experiencing.
Would appreciate if I could get suggestions/explanation for this as well.

Our app uses Spring Batch API to run the batch job that in turn uses DBCP. Its been running
well but on very few occasions, certain threads hang. I was told to check the DB connections
as it heavily uses. Oddly, it fails even on a simple step that takes only one DB connection.
I was using DBCP 1.2.2 (build yr 2006) and recently upgraded to the latest 1.4.


Ignorance more frequently begets confidence than does knowledge - Charles Darwin

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message