Hello,
I'm trying to configure Hibernate to use c3p0 with a Firebird DB but i run into this exception:
Code:
[java] > [exec] java.sql.SQLException: Connections could not be acquired from the underlying database!
[java] > [exec] at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:106)
[java] > [exec] at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:529)
[java] > [exec] at com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.getConnection(AbstractPoolBackedDataSource.java:128)
[java] > [exec] at org.hibernate.connection.C3P0ConnectionProvider.getConnection(C3P0ConnectionProvider.java:56)
[java] > [exec] at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:111)
[java] > [exec] at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2101)
[java] > [exec] at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1325)
[java] > [exec] at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:867)
[java] > [exec] at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:669)
[java] > [exec] at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:126)
[java] > [exec] at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:52)
[java] > [exec] at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:34)
...
[java] > [exec] Caused by: com.mchange.v2.resourcepool.CannotAcquireResourceException: A ResourcePool could not acquire a resource from its primary factory or source.
[java] > [exec] at com.mchange.v2.resourcepool.BasicResourcePool.awaitAvailable(BasicResourcePool.java:1319)
[java] > [exec] at com.mchange.v2.resourcepool.BasicResourcePool.prelimCheckoutResource(BasicResourcePool.java:557)
[java] > [exec] at com.mchange.v2.resourcepool.BasicResourcePool.checkoutResource(BasicResourcePool.java:477)
[java] > [exec] at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:525)
[java] > [exec] ... 17 more
Here is some Hibernate info:
Code:
[Version] Hibernate Annotations 3.4.0.GA
[Environment] Hibernate 3.3.1.GA
[Environment] hibernate.properties not found
[Environment] Bytecode provider name : javassist
[Environment] using JDK 1.4 java.sql.Timestamp handling
[Version] Hibernate Commons Annotations 3.1.0.GA
[Version] Hibernate EntityManager 3.4.0.GA
I'm using c3p0 version 0.9.1.2
Here is my persistence.xml properties for hibernate:
Code:
<property name="hibernate.connection.username" value="director"/>
<property name="hibernate.connection.driver_class" value="org.firebirdsql.jdbc.FBDriver"/>
<property name="hibernate.connection.password" value="director"/>
<property name="hibernate.connection.url" value="jdbc:firebirdsql:127.0.0.1/3050:C:\Firebird\databases\addressdata.fdb"/>
<property name="hibernate.dialect" value="org.hibernate.dialect.FirebirdDialect"/>
<property name="hibernate.show_sql" value="false"/>
<property name="hibernate.cache.user_query_cache" value="false"/>
<property name="hibernate.connection.provider_class" value="org.hibernate.connection.C3P0ConnectionProvider"/>
<property name="hibernate.c3p0.idle_test_period" value="5000"/>
<property name="hibernate.c3p0.min_size" value="1"/>
<property name="hibernate.c3p0.max_size" value="10"/>
<property name="hibernate.c3p0.max_statements" value="0"/>
<property name="hibernate.c3p0.acquire_increment" value="1"/>
<property name="hibernate.c3p0.timeout" value="1800"/>
<property name="hibernate.c3p0.validate" value="true"/>
when i remove the property hibernate.connection.provider_class it works fine using the default provider. So i'm not sure what i might be missing to get this to work with Firebird. I only needed the properties above so i didn't create a c3p0.properties file.
Anyone know what i might be doing wrong?
Thanks