在Oracle10g上使用c3p0配置Hibernate连接池

时间:2011-08-12 00:45:56

标签: java hibernate c3p0

我无法使用c3p0与Hibernate和Oracle建立连接池。数据库是Oracle 10.2,hibernate版本是3.6.5。当我从配置中取出c3p0设置时,它工作正常。

我试图限制请求的连接数和处理的语句,但仍然没有运气。

这是我的config.xml和堆栈跟踪:

<hibernate-configuration>
<session-factory>
    <property name="hibernate.bytecode.use_reflection_optimizer">false</property>
    <property name="hibernate.check_nullability">false</property>
    <property name="hibernate.connection.driver_class">oracle.jdbc.OracleDriver</property>
    <property name="hibernate.connection.password">BLAH</property>
    <property name="hibernate.connection.url">BLAH</property>
    <property name="hibernate.connection.username">BLAH</property>
    <property name="hibernate.current_session_context_class">thread</property>
    <property name="hibernate.dialect">org.hibernate.dialect.Oracle10gDialect</property>
    <property name="hibernate.format_sql">true</property>
    <property name="hibernate.search.autoregister_listeners">false</property>
    <property name="hibernate.show_sql">false</property>
    <!-- c3p0 pooling - not working -->
    <property name="hibernate.c3p0.min_size">1</property>
    <property name="hibernate.c3p0.max_size">1</property>
    <property name="hibernate.c3p0.timeout">100</property>
    <property name="hibernate.c3p0.max_statements">1</property>
    <property name="hibernate.c3p0.acquire_increment">1</property> 

    <mapping resource="com/ht/hitthenet/planet/InvL1Service.hbm.xml" />
    <mapping resource="com/ht/hitthenet/planet/VbbOrderAttributes.hbm.xml" />
    <mapping resource="com/ht/hitthenet/planet/InvPort.hbm.xml" />
    <mapping resource="com/ht/hitthenet/planet/VbbSvcOrder.hbm.xml" />
</session-factory>
</hibernate-configuration>



- com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@c7e8a7 -- Acquisition     Attempt Failed!!! Clearing pending acquires. While trying to acquire a needed new resource, we failed to succeed more than the maximum number of allowed acquisition attempts (30). Last acquisition attempt exception: 
java.sql.SQLException: Unsupported feature
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:162)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:227)
...

1 个答案:

答案 0 :(得分:1)

问题是数据库服务器受IP地址限制的连接。