關於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,但都是一樣的效果,請熟悉的人指點一下原因.
相關文章
- 401、Java框架55 -【Hibernate - C3P0連線池】 2020.10.29Java框架
- 4、資料庫連線池的概念及C3P0、Uruid兩種連線池的使用資料庫UI
- 關於 Homestead 連線 MySQL 問題MySql
- Hibernate【查詢、連線池、逆向工程】
- 用idea配置c3p0連線池Idea
- [20200711]關於左右連線的問題.txt
- 關於canonmx538無線連線的問題
- 解密httpclient,dbcp,jedis,c3p0,druid,okhttp都在使用的連線池技術解密HTTPclientUI
- 【JDBC】使用OracleDataSource建立連線池用於連線OracleJDBCOracle
- Java中的資料庫連線池:HikariCP與C3P0Java資料庫
- 關於在執行java連線MongoDB時遇到的連線超時問題JavaMongoDB
- 資料庫連線(2) - 為什麼C3P0連線池那麼慢資料庫
- 【很全很新】C3P0 連線池和 DBUtils 配合事務使用總結
- 關於linux使用寶塔皮膚安裝mysql無法使用navicat連線的問題LinuxMySql
- 資料庫連線池優化配置(druid,dbcp,c3p0)資料庫優化UI
- 記錄連線數導致警報失效,連線池少問題
- 線上問題總結-獲取不到連線池(logback 配置+程式碼問題)
- SpringBoot中關於 HikariPool、Druid及常用連線池的比較Spring BootUI
- 使用Hibernate、JPA、Lombok遇到的有趣問題Lombok
- 關於android stdio連線mysql資料庫出現過的問題AndroidMySql資料庫
- 在Hibernate中關於Oracle sequence的使用KHOracle
- Hibernate-ORM:13.Hibernate中的連線查詢ORM
- Druid連線池引數maxWait配置錯誤引發的問題UIAI
- 基於 swoole 協程的 MySQL 連線池MySql
- 基於swoole的mysql連線池實現MySql
- 關於MQTT 使用遇到問題MQQT
- hibernate中的no session問題Session
- CentOS 7遠端連線相關問題CentOS
- 資料訪問連線池和執行緒池執行緒
- 關於遠端連線虛擬機器Network error: Connection timed out的問題虛擬機Error
- 關於為前端連線資料庫出現問題答案的尋找(404)前端資料庫
- 關於離線的群聊天記錄問題
- 連線池
- 【MySQL】自定義資料庫連線池和開源資料庫連線池的使用MySql資料庫
- 從原始碼中分析關於phpredis中的連線池可持有數目原始碼PHPRedis
- 基於HiKariCP元件,分析連線池原理元件
- 關於shiro+springMVC整合使用的問題SpringMVC
- 關於在forEach中使用await的問題AI
- Github ssh的連線問題Github