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