Hi,

The DBCP configuration for my app is given below:

        <bean id="oracleDs" class="org.apache.commons.dbcp.BasicDataSource">
                <property name="driverClassName" value="${jdbc.oracle.driver}" 
/>
                <property name="url" value="${jdbc.oracle.url}" />
                <property name="username" value="${jdbc.oracle.user}" />
                <property name="password" value="${jdbc.oracle.password}" />
                <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"/>
        </bean>

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.




Thanks
Pattabi

Ignorance more frequently begets confidence than does knowledge - Charles Darwin


Reply via email to