Sunday, June 26, 2011

C3P0 DataSource Config (Connection-Pool) !

<bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource">
    <property name="driverClass" value="${jdbc.driverClassName}"></property>
    <property name="jdbcUrl" value="${jdbc.url}" />
    <property name="user" value="${jdbc.username}" />
    <property name="password" value="${jdbc.password}" />
    <property name="initialPoolSize" value="5"></property>
    <property name="minPoolSize" value="5"></property>
    <property name="maxPoolSize" value="15" />
    <property name="checkoutTimeout" value="1000" /> <!-- Wartezeit auf freie Pool-Connection -->
    <property name="maxStatements" value="50"></property>
    <property name="automaticTestTable" value="C3P0_TEST_TABLE"></property>
    <property name="testConnectionOnCheckin" value="true"></property>
    <property name="idleConnectionTestPeriod" value="60"></property> <!-- in Sekunden -->
</bean>

No comments:

Post a Comment