-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: How do you configure hibernate to use c3p0 with firebird db?
PostPosted: Fri Apr 13, 2012 12:13 pm 
Newbie

Joined: Fri Apr 13, 2012 11:50 am
Posts: 2
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.