關於hibernate使用c3p0連線池的問題.
曾經一個已經投入執行的專案,是用struts+hibernate元件,後來再把工程開啟來執行時,配置不變的情況下,卻提示:
10:40:11,046 INFO C3P0Registry:77 - Initializing c3p0-0.9.0 [built 11-July-2005 00:43:29 -0400; debug? true; trace: 10]
10:40:11,562 INFO PoolBackedDataSource:257 - Initializing c3p0 pool... com.mchange.v2.c3p0.PoolBackedDataSource@1606bf5 [ connectionPoolDataSource -> com.mchange.v2.c3p0.WrapperConnectionPoolDataSource@196c0a0 [ acquireIncrement -> 1, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 0, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, identityToken -> 196c0a0, idleConnectionTestPeriod -> 100, initialPoolSize -> 10, maxIdleTime -> 100, maxPoolSize -> 100, maxStatements -> 0, maxStatementsPerConnection -> 0, minPoolSize -> 10, nestedDataSource -> com.mchange.v2.c3p0.DriverManagerDataSource@29d838 [ description -> null, driverClass -> null, factoryClassLocation -> null, identityToken -> 29d838, jdbcUrl -> jdbc:microsoft:sqlserver://localhost:1433, properties -> {user=******, password=******} ], preferredTestQuery -> null, propertyCycle -> 300, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, usesTraditionalReflectiveProxies -> false ], factoryClassLocation -> null, identityToken -> 1606bf5, numHelperThreads -> 3 ]
10:41:14,093 WARN BasicResourcePool:1222 - com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@f8db08 -- 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).
10:41:14,515 WARN Configurator:126 - No configuration found. Configuring ehcache from ehcache-failsafe.xml found in the classpath: file:/D:/Tomcat/work/Catalina/localhost/KBPM/loader/ehcache-failsafe.xml
10:41:15,281 WARN BasicResourcePool:1222 - com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@4dd413 -- 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).
10:42:29,546 WARN BasicResourcePool:1222 - com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@19d56e9 -- 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).
10:42:29,546 ERROR JDBCExceptionReporter:72 - Connections could not be acquired from the underlying database!
10:42:29,578 ERROR BaseHibernateDAO:204 - 查詢資料庫失敗
10:42:29,578 INFO ConfigConstants:40 - 呼叫getProperty
10:42:29,578 WARN RequestProcessor:516 - Unhandled Exception thrown: class java.lang.NullPointerException
----------------------------------------------------
hibernate的配置檔案關於c3p0的程式碼片段如下:
<!-- configuration pool via c3p0-->
<property name="c3p0.acquire_increment">30</property>
<property name="c3p0.idle_test_period">100</property> <!-- seconds -->
<property name="c3p0.max_size">100</property>
<property name="c3p0.max_statements">0</property>
<property name="c3p0.min_size">10</property>
<property name="c3p0.timeout">100</property> <!-- seconds -->
<!-- DEPRECATED very expensive property name="c3p0.validate>-->
其中c3p0.acquire_increment曾設成1,10,100,31如今是設成30,但都是一樣的效果,請熟悉的人指點一下原因.
10:40:11,046 INFO C3P0Registry:77 - Initializing c3p0-0.9.0 [built 11-July-2005 00:43:29 -0400; debug? true; trace: 10]
10:40:11,562 INFO PoolBackedDataSource:257 - Initializing c3p0 pool... com.mchange.v2.c3p0.PoolBackedDataSource@1606bf5 [ connectionPoolDataSource -> com.mchange.v2.c3p0.WrapperConnectionPoolDataSource@196c0a0 [ acquireIncrement -> 1, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 0, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, identityToken -> 196c0a0, idleConnectionTestPeriod -> 100, initialPoolSize -> 10, maxIdleTime -> 100, maxPoolSize -> 100, maxStatements -> 0, maxStatementsPerConnection -> 0, minPoolSize -> 10, nestedDataSource -> com.mchange.v2.c3p0.DriverManagerDataSource@29d838 [ description -> null, driverClass -> null, factoryClassLocation -> null, identityToken -> 29d838, jdbcUrl -> jdbc:microsoft:sqlserver://localhost:1433, properties -> {user=******, password=******} ], preferredTestQuery -> null, propertyCycle -> 300, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, usesTraditionalReflectiveProxies -> false ], factoryClassLocation -> null, identityToken -> 1606bf5, numHelperThreads -> 3 ]
10:41:14,093 WARN BasicResourcePool:1222 - com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@f8db08 -- 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).
10:41:14,515 WARN Configurator:126 - No configuration found. Configuring ehcache from ehcache-failsafe.xml found in the classpath: file:/D:/Tomcat/work/Catalina/localhost/KBPM/loader/ehcache-failsafe.xml
10:41:15,281 WARN BasicResourcePool:1222 - com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@4dd413 -- 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).
10:42:29,546 WARN BasicResourcePool:1222 - com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@19d56e9 -- 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).
10:42:29,546 ERROR JDBCExceptionReporter:72 - Connections could not be acquired from the underlying database!
10:42:29,578 ERROR BaseHibernateDAO:204 - 查詢資料庫失敗
10:42:29,578 INFO ConfigConstants:40 - 呼叫getProperty
10:42:29,578 WARN RequestProcessor:516 - Unhandled Exception thrown: class java.lang.NullPointerException
----------------------------------------------------
hibernate的配置檔案關於c3p0的程式碼片段如下:
<!-- configuration pool via c3p0-->
<property name="c3p0.acquire_increment">30</property>
<property name="c3p0.idle_test_period">100</property> <!-- seconds -->
<property name="c3p0.max_size">100</property>
<property name="c3p0.max_statements">0</property>
<property name="c3p0.min_size">10</property>
<property name="c3p0.timeout">100</property> <!-- seconds -->
<!-- DEPRECATED very expensive property name="c3p0.validate>-->
其中c3p0.acquire_increment曾設成1,10,100,31如今是設成30,但都是一樣的效果,請熟悉的人指點一下原因.
相關文章
- Hibernate使用C3P0的連線池
- 關於連線池的問題!
- hibernate資料庫連線池的問題資料庫
- c3p0資料庫連線池問題資料庫
- 關與連線池的配置問題!
- 關於tomcat資料庫連線池的問題Tomcat資料庫
- 請高手幫忙,關於多個連線的hibernate配置問題
- 關於mysql連線的問題MySql
- 請教jdon關於連線池對應的遊標問題
- 請教關於資料庫連線池的設定問題?資料庫
- Hibernate連線池配置
- 關於WebLogic 訪問Oracle 資料庫(建立連線池)問題WebOracle資料庫
- 請教關於連線池導至系統出錯的問題
- 4、資料庫連線池的概念及C3P0、Uruid兩種連線池的使用資料庫UI
- 弱弱的問一個菜鳥問題(關於單態和連線池)
- 關於jetty連線關閉問題Jetty
- tomcat連線池問題Tomcat
- 問個jrun連線池的問題
- 關於資料庫連線池資料庫
- 請問,關於資料庫連線的問題。資料庫
- 關於 Homestead 連線 MySQL 問題MySql
- 資料庫連線池的問題,連線池物件為靜態變數有問題麼資料庫物件變數
- 用idea配置c3p0連線池Idea
- 401、Java框架55 -【Hibernate - C3P0連線池】 2020.10.29Java框架
- 關於 Hibernate快取的問題快取
- 關於Hibernate的查詢問題
- 關於canonmx538無線連線的問題
- spring+hibernate 連線mysql的問題SpringMySql
- 問一個關於hibernate的OracleDialect問題Oracle
- 【JDBC】使用OracleDataSource建立連線池用於連線OracleJDBCOracle
- 關於JPetstore連線資料庫問題資料庫
- Hibernate【查詢、連線池、逆向工程】
- Java Hibernate 之連線池詳解Java
- 請教關於資料庫連線的問題資料庫
- 各位十一好,問一個有關weblogic 8的連線池的問題Web
- weblogic +mysql 連線池 中文問題??WebMySql
- spring2.5 + hibernate 3 框架中用c3p0連線sql 2000出現問題。Spring框架SQL
- 一個資料庫連線池的問題資料庫