Druid,interrupt异常问题

书一 发布于 2013/08/16 14:48
阅读 1K+
收藏 0

@wenshao 

这个错误是什么引起的,我使用ThreadPoolExecutor运行多线程,调用shutdownNow关闭线程的时候出现的,

java.sql.SQLException: interrupt
	at com.alibaba.druid.pool.DruidDataSource.getConnectionInternal(DruidDataSource.java:809)
	at com.alibaba.druid.pool.DruidDataSource.getConnectionDirect(DruidDataSource.java:712)
	at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:696)
	at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:686)
	at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:85)
	at my.db.DBManager._getConnection(DBManager.java:210)
	at my.db.DBManager.getConnection(DBManager.java:192)
	at my.db.QueryHelper.getConnection(QueryHelper.java:69)
	at my.db.QueryHelper.batch(QueryHelper.java:294)
	at net.chinasource.beans.update.SoftwareUpdate.batch(SoftwareUpdate.java:163)
	at net.chinasource.beans.update.UpdateService.save(UpdateService.java:189)
	at net.chinasource.beans.update.UpdateService$2.run(UpdateService.java:129)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.InterruptedException
	at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireInterruptibly(Unknown Source)
	at java.util.concurrent.locks.ReentrantLock.lockInterruptibly(Unknown Source)
	at com.alibaba.druid.pool.DruidDataSource.getConnectionInternal(DruidDataSource.java:806)
	... 14 more

java.sql.SQLException: Unabled to get connection.
	at my.db.DBManager.getConnection(DBManager.java:194)
	at my.db.QueryHelper.getConnection(QueryHelper.java:69)
	at my.db.QueryHelper.batch(QueryHelper.java:294)
	at net.chinasource.beans.update.SoftwareUpdate.batch(SoftwareUpdate.java:163)
	at net.chinasource.beans.update.UpdateService.save(UpdateService.java:189)
	at net.chinasource.beans.update.UpdateService$2.run(UpdateService.java:129)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source) 
加载中
0
明月照大江
明月照大江
你的线程和 druid 干扰了?
书一
书一
线程里面会调用druid获取链接保存数据,单个线程的数据由自己保存,
返回顶部
顶部