c3p0无效

时间:2017-03-14 15:18:13

标签: java hibernate c3p0

我的c3p0不尊重我的应用程序的会话优化。活动会话达到阈值(设置为800),最终必须重新启动应用程序。当我设置c3p0时,这不应该发生。 我目前的情况如下:

<!-- JDBC connection pool settings -->
        <property name="connection.provider_class">org.hibernate.service.jdbc.connections.internal.C3P0ConnectionProvider</property>
        <property name="c3p0.max_size">100</property>
        <property name="c3p0.min_size">5</property>

        <!-- The seconds a Connection can remain pooled but unused before being discarded. Zero means idle connections never expire -->
        <property name="c3p0.timeout">300</property>

        <!-- for Oracle set 'max_statements' to 0 set to 100 otherwise 
        <property name="c3p0.max_statements">0</property>

        <!-- If this is a number greater than 0, c3p0 will test all idle, pooled but unchecked-out connections, every this number of seconds -->
        <property name="c3p0.idle_test_period">120</property>

        <!-- Determines how many connections at a time c3p0 will try to acquire when the pool is exhausted -->
        <property name="c3p0.acquire_increment">1</property>

        <property name="hibernate.jdbc.batch_size">100</property>

使用的罐子:

  • hibernate-c3p0-4.2.1.Final.jar
  • c3p0-0.9.5.2.jar
  • mchange-commons-java-0.2.11

数据库:Oracle

我的问题是:

  1. 我的c3p0设置如何有效?
  2. 优化需要一些额外的参数吗?应 我在生产环境中使用了更多属性吗?

0 个答案:

没有答案