2013-02-18 8 views
6

In der folgenden Konfiguration, wenn ich Anfangs-, Max-, Min-Pool-Größe verpasst. Wie lauten die Standardgrößen für Verbindungspools in c3p0?Was ist die Standardgröße der Verbindungspools 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> 

Antwort

15

Die InitialPoolSize ist standardmäßig 3.

Sie können auf die folgenden Links prüfen für weitere Informationen:

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

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

+0

+1 für die Angebotsdokumentation, sollte diese Antwort akzeptiert worden sein. –

+0

@TomaszNurkiewicz: Danke :) aber immer noch antworteten Sie mir ... –

+0

NB, dass Sie diese Werte auch in c3p0.properties oder Hibernate's Config setzen können: https://Stackoverflow.com/a/28520978/32453 – rogerdpack

4

Auszug aus 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; 

Allerdings, wenn es nicht dokumentiert ist, nicht auf Standard verlassen.

Verwandte Themen