標籤:connect prepare runner size 解決 rac emerge statement sql
一,c3p0執行一段時間後報錯例如以下
W 07-26_00:58:27 ThreadPoolAsynchronousRunner.java 608 com[email protected]70929ab6 -- APPARENT DEADLOCK!!! Creating emergency threads for unassigned pending tasks! W 07-26_00:58:39 ThreadPoolAsynchronousRunner.java 608 com[email protected]4496b93a -- APPARENT DEADLOCK!!! Creating emergency threads for unassigned pending tasks!
二,解決方案例如以下
1,更新c3p0版本號碼到0.9.2.1 該版本號碼最佳化了擷取connection的規則
2,首先改動c3p0配置參數
<!--JDBC的標準參數。用以控制資料來源內載入的PreparedStatements數量。但因為預緩衝的statements 屬於單個connection而不是整個串連池。所以設定這個參數須要考慮到多方面的因素。 假設maxStatements與maxStatementsPerConnection均為0,則緩衝被關閉。Default: 0--> <property name="maxStatements" value="0"/><!--串連池用完時客戶調用getConnection()後等待擷取串連的時間。單位:毫秒。逾時後會拋出--> <!--SQLEXCEPTION,假設設定0,則無限等待。Default:0--> <property name="checkoutTimeout" value="100"/>
C3P0 APPARENT DEADLOCK