异常: com.alibaba.druid.pool.DataSourceDisableException
使用druid的线程池.
开了10000个线程操作数据库后出现这个bug(启用了事务)
Exception in thread "pool-2-thread-10" org.springframework.transaction.CannotCreateTransactionException: Could not open JDBC Connection for transaction; nested exception is com.alibaba.druid.pool.DataSourceDisableException
at org.springframework.jdbc.datasource.DataSourceTransactionManager.doBegin(DataSourceTransactionManager.java:305)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:378)
at org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspectSupport.java:474)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:289)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:98)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:688)
at com.jfai.afs.core.service.ChargingService$$EnhancerBySpringCGLIB$$fc84754f.increaseQueryNum(<generated>)
at com.jfai.afs.core.service.ChargingService$1.run(ChargingService.java:72)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: com.alibaba.druid.pool.DataSourceDisableException
at com.alibaba.druid.pool.DruidDataSource.pollLast(DruidDataSource.java:1841)
at com.alibaba.druid.pool.DruidDataSource.getConnectionInternal(DruidDataSource.java:1371)
at com.alibaba.druid.pool.DruidDataSource.getConnectionDirect(DruidDataSource.java:1241)
at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:1221)
at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:1211)
at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:105)
at org.springframework.jdbc.datasource.DataSourceTransactionManager.doBegin(DataSourceTransactionManager.java:262)
... 11 more
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
没有完整的栈输出,猜测是超出数据库的最大连接数了。。。