I am using c3p0-0.9.1.2.jar and hibernate 3.2.1. Following are the hibernate config.
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.connection.url">jdbc:mysql://localhost:3306/oDB</property>
<property name="hibernate.connection.username">oDBUser</property>
<property name="hibernate.connection.zeroDateTimeBehavior">convertToNull</property>
<property name="hibernate.connection.autoReconnect">true</property>
<property name="c3p0.max_size">10</property>
<property name="c3p0.min_size">4</property>
<property name="c3p0.timeout">1800</property>
<property name="c3p0.max_statements">200</property>
<property name="c3p0.maxStatementsPerConnection">5</property>
<property name="c3p0.idle_test_period">1500</property>
<property name="c3p0.acquire_increment">2</property>
<property name="c3p0.testConnectionOnCheckout">true</property>
<property name="c3p0.preferredTestQuery">SELECT 1</property>
But I don't think the params like maxStatementsPerConnection, testConnectionOnCheckout and preferredTestQuery are having any effect at runtime. Should I do something else for these params? Here is what I get in the log.
INFO 2010-11-06 19:04:37,364 Initializing c3p0 pool... com.mchange.v2.c3p0.PoolBackedDataSource@e2da87d1 [ connectionPoolDataSource -> com.mchange.v2.c3p0.WrapperConnectionPoolDataSource@412cca1a [ acquireIncrement -> 2, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 0, connectionCustomizerClassName -> null, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, debugUnreturnedConnectionStackTraces -> false, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, identityToken -> z8kfsx8c99kx7g8xqvs4|87400, idleConnectionTestPeriod -> 1500, initialPoolSize -> 4, maxAdministrativeTaskTime -> 0, maxConnectionAge -> 0, maxIdleTime -> 1800, maxIdleTimeExcessConnections -> 0, maxPoolSize -> 10, maxStatements -> 200, maxStatementsPerConnection -> 0, minPoolSize -> 4, nestedDataSource -> com.mchange.v2.c3p0.DriverManagerDataSource@9d074b3f [ description -> null, driverClass -> null, factoryClassLocation -> null, identityToken -> z8kfsx8c99kx7g8xqvs4|b245dc, jdbcUrl -> jdbc:mysql://localhost:3306/oDB, properties -> {autoReconnect=true, user=*, password=*, zeroDateTimeBehavior=convertToNull} ], preferredTestQuery -> null, propertyCycle -> 0, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, unreturnedConnectionTimeout -> 0, usesTraditionalReflectiveProxies -> false; userOverrides: {} ], dataSourceName -> null, factoryClassLocation -> null, identityToken -> z8kfsx8c99kx7g8xqvs4|93c5e7, numHelperThreads -> 3 ]
Thanks in advance. Goura