1

私はc3p0-0.9.1.2.jarhibernate 3.2.1を使用しています。以下は休止状態の設定です。

    <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
    <property name="hibernate.connection.url">jdbc:mysql://localhost:3306/oDB</property>
    <property name="hibernate.connection.username">oDBUser</property>
    <property name="hibernate.connection.zeroDateTimeBehavior">convertToNull</property>
    <property name="hibernate.connection.autoReconnect">true</property>

    <property name="c3p0.max_size">10</property>
    <property name="c3p0.min_size">4</property>
    <property name="c3p0.timeout">1800</property>
    <property name="c3p0.max_statements">200</property>
    <property name="c3p0.maxStatementsPerConnection">5</property>
    <property name="c3p0.idle_test_period">1500</property>
    <property name="c3p0.acquire_increment">2</property>
    <property name="c3p0.testConnectionOnCheckout">true</property>
    <property name="c3p0.preferredTestQuery">SELECT 1</property>

しかし、maxStatementsPerConnection、testConnectionOnCheckout、preferredTestQuery などのパラメーターが実行時に影響しているとは思いません。これらのパラメーターに対して何か他のことをする必要がありますか? これが私がログに記録するものです。

INFO 2010-11-06 19:04:37,364 c3p0 プールを初期化しています... com.mchange.v2.c3p0.PoolBackedDataSource@e2da87d1 [ connectionPoolDataSource -> com.mchange.v2.c3p0.WrapperConnectionPoolDataSource@412cca1a [acquireIncrement -> 2, acquireRetryAttempts -> 30、acquireRetryDelay -> 1000、autoCommitOnClose -> false、automaticTestTable -> null、breakAfterAcquireFailure -> false、checkoutTimeout -> 0、connectionCustomizerClassName -> null、connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester、debugUnreturnedConnectionStackTraces -> false、factoryClassLocation -> null、forceIgnoreUnresolvedTransactions -> false、identityToken -> z8kfsx8c99kx7g8xqvs4|87400、idleConnectionTestPeriod -> 1500、initialPoolSize -> 4、maxAdministrativeTaskTime -> 0、maxConnectionAge -> 0、maxIdleTime ->1800、maxIdleTimeExcessConnections -> 0、maxPoolSize -> 10、maxStatements -> 200、maxStatementsPerConnection -> 0、minPoolSize -> 4、nestedDataSource -> com.mchange.v2.c3p0.DriverManagerDataSource@9d074b3f [説明 -> null、driverClass -> null、factoryClassLocation -> null、identityToken -> z8kfsx8c99kx7g8xqvs4|b245dc、jdbcUrl -> jdbc:mysql://localhost:3306/oDB、プロパティ -> {autoReconnect=true、user= *、パスワード=* , zeroDateTimeBehavior=convertToNull} ], preferredTestQuery -> null , propertyCycle -> 0, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false , unreturnedConnectionTimeout -> 0, usesTraditionalReflectiveProxies -> false; userOverrides: {} ], dataSourceName -> null, factoryClassLocation -> null, identityToken -> z8kfsx8c99kx7g8xqvs4|93c5e7, numHelperThreads -> 3 ]

前もって感謝します。強羅

4

1 に答える 1

2

しかし、maxStatementsPerConnection、testConnectionOnCheckout、preferredTestQuery などのパラメーターが実行時に影響しているとは思いません。これらのパラメーターに対して何か他のことをする必要がありますか?

これらは Hibernate 構成ファイルには含まれません。ファイルを提供する必要がありc3p0.propertiesます。C3P0 ドキュメントの付録 C: Hibernate 固有の注意事項を参照してください。

于 2010-11-07T10:24:32.473 に答える