Caused by: com.mchange.v2.resourcepool.TimeoutException: A client timed out while waiting to acquire a resource from com.mchange.v2.resourcepool.BasicResourcePool@1483de4 -- timeout at awaitAvailable(


Caused by: com.mchange.v2.resourcepool.TimeoutException: A client timed out while waiting to acquire a resource from com.mchange.v2.resourcepool.BasicResourcePool@1483de4 -- timeout at awaitAvailable()

 

把spring-dao.xml中

<property name="maxPoolSize" value="30"/>
改成
<property name="maxPoolSize" value="40"/>
運行正常,不拋出異常
再重新改回
<property name="maxPoolSize" value="30"/>
運行正常,沒有異常

有可能是多運行幾次,就不會有異常了?不能解決

解決辦法
將url加上autoReconnect=true&rewriteBatchedStatements=TRUE
jdbc.url=jdbc:mysql://127.0.0.1:3306/seckill?useUnicode=true&characterEncoding=utf8&autoReconnect=true&rewriteBatchedStatements=TRUE
 
 
 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM