Hi,
I'm having trouble making C3P0 to work. Using the hibernate internal connection pooling, everything is Ok. As soon as I swith to C3P0 setting the (hibernate.c3p0.max_size property), I get the error log below when hibernate tries to get a connection.
Any ideas ?
Bruno
My hibernate config file:
======================
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="hibernate.dialect">org.hibernate.dialect.MySQLMyISAMDialect</property>
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.connection.url">jdbc:mysql://localhost/test</property>
<property name="hibernate.connection.password">mypass</property>
<property name="hibernate.connection.username">root</property>
<property name="hibernate.c3p0.max_size">10</property>
<property name="hibernate.jdbc.batch_versioned_data">true</property>
<property name="hibernate.query.substitutions">true 1, false 0, yes 'Y', no 'N'</property>
<property name="hibernate.cache.region_prefix">hibernate.test</property>
<property name="hibernate.proxool.pool_alias">pool1</property>
<property name="hibernate.default_batch_fetch_size">8</property>
<property name="hibernate.jdbc.use_streams_for_binary">true</property>
<property name="hibernate.max_fetch_depth">1</property>
<property name="hibernate.cache.provider_class">org.hibernate.cache.HashtableCacheProvider</property>
<property name="hibernate.use_sql_comments">true</property>
<property name="hibernate.order_updates">true</property>
</session-factory>
</hibernate-configuration>
======================
Hibernate version:
3.1 beta1
Mapping documents:
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
Name and version of the database you are using:
MySQL 4.1.10a-nt
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt:
15:54:54,821 org.hibernate.util.JDBCExceptionReporter WARN - SQL Error: 0, SQLState: null
15:54:54,821 org.hibernate.util.JDBCExceptionReporter ERROR - com.mchange.v2.c3p0.PoolBackedDataSource@1d18ac9 [ connectionPoolDataSource -> com.mchange.v2.c3p0.WrapperConnectionPoolDataSource@17d2a06 [ acquireIncrement -> 1, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 0, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, identityToken -> 17d2a06, idleConnectionTestPeriod -> 0, initialPoolSize -> 1, maxIdleTime -> 0, maxPoolSize -> 10, maxStatements -> 0, maxStatementsPerConnection -> 0, minPoolSize -> 1, nestedDataSource -> com.mchange.v2.c3p0.DriverManagerDataSource@1db296e [ description -> null, driverClass -> null, factoryClassLocation -> null, identityToken -> 1db296e, jdbcUrl -> jdbc:mysql://localhost/test, properties -> {user=******, password=******} ], preferredTestQuery -> null, propertyCycle -> 300, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, usesTraditionalReflectiveProxies -> false ], factoryClassLocation -> null, identityToken -> 1d18ac9, numHelperThreads -> 3 ] has been closed() -- you can no longer use it.
15:54:54,821 net.sf.oreka.services.RecSegmentServiceHbn ERROR - org.hibernate.exception.GenericJDBCException: Cannot open connection
|