首页 新闻 会员 周边 捐助

使用阿里开源连接池druid在线程里面提交事务时异常 Messages: recyle error

0
悬赏园豆:120 [已关闭问题] 关闭于 2016-03-31 13:19

Messages: recyle error
java.lang.InterruptedException
        at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireInterruptibly(AbstractQueuedSynchronizer.java:1220)
        at java.util.concurrent.locks.ReentrantLock.lockInterruptibly(ReentrantLock.java:335)
        at com.alibaba.druid.pool.DruidDataSource.recycle(DruidDataSource.java:1281)
        at com.alibaba.druid.pool.DruidPooledConnection.recycle(DruidPooledConnection.java:297)
        at com.alibaba.druid.filter.FilterChainImpl.dataSource_recycle(FilterChainImpl.java:4534)
        at com.alibaba.druid.filter.stat.StatFilter.dataSource_releaseConnection(StatFilter.java:647)
        at com.alibaba.druid.filter.FilterChainImpl.dataSource_recycle(FilterChainImpl.java:4530)
        at com.alibaba.druid.pool.DruidPooledConnection.close(DruidPooledConnection.java:245)
        at org.springframework.jdbc.datasource.DataSourceUtils.doCloseConnection(DataSourceUtils.java:341)
        at org.springframework.jdbc.datasource.DataSourceUtils.doReleaseConnection(DataSourceUtils.java:328)
        at org.springframework.jdbc.datasource.DataSourceUtils.releaseConnection(DataSourceUtils.java:294)
        at org.springframework.jdbc.datasource.DataSourceTransactionManager.doCleanupAfterCompletion(DataSourceTransactionManager.java:329)
        at org.springframework.transaction.support.AbstractPlatformTransactionManager.cleanupAfterCompletion(AbstractPlatformTransactionManager.java:1016)
        at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:811)
        at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:730)

沉浸其中的主页 沉浸其中 | 初学一级 | 园豆:182
提问于:2016-03-05 16:27
< >
分享
所有回答(2)
0

这个问题解决了么?哎,都没什么人回答啊

 

文苏 | 园豆:204 (菜鸟二级) | 2016-06-21 17:40
0

在使用数据库连接过程中异常退出,未及时释放连接引发异常

2018-04-02 17:34:44,527 ERROR [DruidDataSource.java:1206] : recyle error

java.lang.InterruptedException

at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireInterruptibly(AbstractQueuedSynchronizer.java:1220)

at java.util.concurrent.locks.ReentrantLock.lockInterruptibly(ReentrantLock.java:335)

at com.alibaba.druid.pool.DruidDataSource.recycle(DruidDataSource.java:1188)

at com.alibaba.druid.pool.DruidPooledConnection.recycle(DruidPooledConnection.java:285)

at com.alibaba.druid.filter.FilterChainImpl.dataSource_recycle(FilterChainImpl.java:4524)

at com.alibaba.druid.filter.stat.StatFilter.dataSource_releaseConnection(StatFilter.java:646)

at com.alibaba.druid.filter.FilterChainImpl.dataSource_recycle(FilterChainImpl.java:4520)

at com.alibaba.druid.pool.DruidPooledConnection.syncClose(DruidPooledConnection.java:262)

at com.alibaba.druid.pool.DruidPooledConnection.close(DruidPooledConnection.java:221)

at org.springframework.jdbc.datasource.DataSourceUtils.doCloseConnection(DataSourceUtils.java:341)

at org.springframework.jdbc.datasource.DataSourceUtils.doReleaseConnection(DataSourceUtils.java:328)

at org.springframework.jdbc.datasource.DataSourceUtils.releaseConnection(DataSourceUtils.java:294)

at org.mybatis.spring.transaction.SpringManagedTransaction.close(SpringManagedTransaction.java:127)

at org.apache.ibatis.executor.BaseExecutor.close(BaseExecutor.java:90)

at org.apache.ibatis.executor.CachingExecutor.close(CachingExecutor.java:64)

at org.apache.ibatis.session.defaults.DefaultSqlSession.close(DefaultSqlSession.java:264)

at org.mybatis.spring.SqlSessionUtils.closeSqlSession(SqlSessionUtils.java:193)

at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:454)

at com.sun.proxy.$Proxy21.selectOne(Unknown Source)

at org.mybatis.spring.SqlSessionTemplate.selectOne(SqlSessionTemplate.java:166)

at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:82)

at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:59)

at com.sun.proxy.$Proxy26.getCountByShopareaNameAndArea(Unknown Source)

at com.yingke.core.shoparea.biz.ShopareaBiz$DuplicateTask.call(ShopareaBiz.java:505)

at com.yingke.core.shoparea.biz.ShopareaBiz$DuplicateTask.call(ShopareaBiz.java:1)

at java.util.concurrent.FutureTask.run(FutureTask.java:266)

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)

解决:

由于线程池中的任务异常结束,并引发druid连接异常回收。这个时候,多去查看一下,线程池中哪些任务并没有优雅释放,或者有异常

翎野君 | 园豆:404 (菜鸟二级) | 2018-04-20 07:49
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册