Selvam Rajendran
Selvam Rajendran

Reputation: 1376

What is the default connection pool sizes in c3p0

In the below config, If I missed initial, max, min pool size. What will be the default connection pool sizes in c3p0?

<bean class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close" id="dataSource">
    <property name="driverClass" value="${dbDriver}"/>
    <property name="jdbcUrl" value="${dbURL}"/>
    <property name="user" value="${dbUsername}"/>
    <property name="password" value="${dbPassword}"/>
    <property name="initialPoolSize" value="5"/>
    <property name="maxPoolSize" value="50"/>
    <property name="minPoolSize" value="5"/>
    <property name="maxIdleTime" value="3000"/>
</bean>

Upvotes: 7

Views: 20671

Answers (3)

chammu
chammu

Reputation: 1305

You may find this link further helpful. https://developer.jboss.org/wiki/HowToConfigureTheC3P0ConnectionPool

Upvotes: 1

Anubhav Ranjan
Anubhav Ranjan

Reputation: 1588

The InitialPoolSize is 3 by default.

You can check the below links for more info:

http://www.mchange.com/projects/c3p0/#initialPoolSize

http://javatech.org/2007/11/c3p0-connectionpool-configuration-rules-of-thumb/

Upvotes: 18

Tomasz Nurkiewicz
Tomasz Nurkiewicz

Reputation: 340708

Excerpt from com.mchange.v2.c3p0.impl.C3P0Defaults:

private final static int INITIAL_POOL_SIZE     = 3;  
private final static int MIN_POOL_SIZE         = 3;
private final static int MAX_POOL_SIZE         = 15;

However if it's not documented, don't rely on default.

Upvotes: 6

Related Questions