我正在将Embedded Derby Derby 10.15.2.0
与 Hibernate 5.4.14
Driver和c3p0 jar被添加到项目类路径中,但是不知道为什么我得到
ERROR: An SQLException was provoked by the following failure: com.mchange.v2.resourcepool.NoGoodResourcesException: After checking so many resources we blew the stack, no resources tested acceptable for checkout. See logger com.mchange.v2.resourcepool.BasicResourcePool output at FINER/DEBUG for information on individual failures.
和
Caused by: org.hibernate.exception.GenericJDBCException: Unable to acquire JDBC Connection
这里是Hibernate.cfg.xml
<hibernate-configuration>
<session-factory>
<property name="hibernate.dialect">org.hibernate.dialect.DerbyTenSevenDialect</property>
<property name="hibernate.connection.driver_class">org.apache.derby.jdbc.EmbeddedDriver</property>
<property name="hibernate.connection.url">jdbc:derby:/home/.netbeans/11.0/derby/clientieFX</property>
<property name="hibernate.connection.username">app</property>
<property name="hibernate.connection.password">app</property>
<property name="hibernate.default_schema">APP</property>
<property name="hibernate.enable_lazy_load_no_trans">true</property>
<property name="current_session_context_class">thread</property>
<property name="hibernate.c3p0.acquire_increment">1</property>
<property name="hibernate.c3p0.min_size">5</property>
<property name="hibernate.c3p0.max_size">20</property>
<property name="hibernate.c3p0.timeout">300</property>
<property name="hibernate.c3p0.maxIdleTimeExcessConnections">300</property>
<property name="hibernate.c3p0.numHelperThreads">6</property>
<property name="hibernate.c3p0.unreturnedConnectionTimeout">3600</property>
<property name="hibernate.c3p0.debugUnreturnedConnectionTimeout">true</property>
<property name="hibernate.c3p0.max_statements">1000</property>
<property name="hibernate.c3p0.preferredTestQuery">/* ping */</property>
<property name="hibernate.c3p0.testConnectionOnCheckout">true</property>
<property name="hibernate.connection.release_mode">on_close</property>
<mapping resource="com/clientie/pojo/Order.hbm.xml"/>
<mapping resource="com/clientie/pojo/Client.hbm.xml"/>
<mapping resource="com/clientie/pojo/Product.hbm.xml"/>
<mapping resource="com/clientie/pojo/User.hbm.xml"/>
</session-factory>
</hibernate-configuration>
我尝试了更改属性,但是它不起作用。
为什么它无法连接?