spring+ibatis 连接池泄漏怎么排查 数据库连接泄漏为0.连接池inative_connection_timeout设置0
spring+ibatis连接池泄漏怎么排查数据库方面连接会话是还有很多未使用,看了控制台监控服务的,数据库连接泄漏为0.连接池inative_connection_ti...
spring+ibatis 连接池泄漏怎么排查
数据库方面连接会话是还有很多未使用,看了控制台监控服务的,数据库连接泄漏为0.连接池inative_connection_timeout设置0,数据库方面连接会话是还有很多未使用,在同个应用服务中,其它功能可以正常使用,就某个定时任务使用(25秒执行一次),在action中通过spring的ApplicationContext来getBean获取连接(怀疑这里导致内存泄漏),请问有什么方法可以排查程序中的数据库连接泄漏
报错信息:
org.springframework.transaction.CannotCreateTransactionException: Could not open JDBC Connection for transaction; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot get a connection, pool exhausted
Caused by: org.apache.commons.dbcp.SQLNestedException: Cannot get a connection, pool exhausted
at org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:103)
at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:540)
at com.eshore.tpcm.pub.datasource.MultiDataSource.getConnection(MultiDataSource.java:153)
at com.poson.daopub.database.datasource.MultiDataSource.getConnection(MultiDataSource.java:31)
at org.springframework.jdbc.datasource.DataSourceTransactionManager.doBegin(DataSourceTransactionManager.java:182)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:315)
at org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspectSupport.java:257)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:102)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:652)
at com.eshore.tpcm.intf.cuv.service.impl.BpmCuvMsgProcThreeServiceImpl$$EnhancerByCGLIB$$2ade596f.getPendingData(<generated>)
at com.eshore.tpcm.intf.cuv.task.BpmCuvMsgProcThreeTask.run(BpmCuvMsgProcThreeTask.java:62)
Caused by: java.util.NoSuchElementException: Timeout waiting for idle object
at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:825)
at org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:95)
... 15 more 展开
数据库方面连接会话是还有很多未使用,看了控制台监控服务的,数据库连接泄漏为0.连接池inative_connection_timeout设置0,数据库方面连接会话是还有很多未使用,在同个应用服务中,其它功能可以正常使用,就某个定时任务使用(25秒执行一次),在action中通过spring的ApplicationContext来getBean获取连接(怀疑这里导致内存泄漏),请问有什么方法可以排查程序中的数据库连接泄漏
报错信息:
org.springframework.transaction.CannotCreateTransactionException: Could not open JDBC Connection for transaction; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot get a connection, pool exhausted
Caused by: org.apache.commons.dbcp.SQLNestedException: Cannot get a connection, pool exhausted
at org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:103)
at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:540)
at com.eshore.tpcm.pub.datasource.MultiDataSource.getConnection(MultiDataSource.java:153)
at com.poson.daopub.database.datasource.MultiDataSource.getConnection(MultiDataSource.java:31)
at org.springframework.jdbc.datasource.DataSourceTransactionManager.doBegin(DataSourceTransactionManager.java:182)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:315)
at org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspectSupport.java:257)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:102)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:652)
at com.eshore.tpcm.intf.cuv.service.impl.BpmCuvMsgProcThreeServiceImpl$$EnhancerByCGLIB$$2ade596f.getPendingData(<generated>)
at com.eshore.tpcm.intf.cuv.task.BpmCuvMsgProcThreeTask.run(BpmCuvMsgProcThreeTask.java:62)
Caused by: java.util.NoSuchElementException: Timeout waiting for idle object
at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:825)
at org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:95)
... 15 more 展开
1个回答
大雅新科技有限公司
2024-11-19 广告
2024-11-19 广告
这方面更多更全面的信息其实可以找下大雅新。深圳市大雅新科技有限公司从事KVM延长器,DVI延长器,USB延长器,键盘鼠标延长器,双绞线视频传输器,VGA视频双绞线传输器,VGA延长器,VGA视频延长器,DVI KVM 切换器等,优质供应商,...
点击进入详情页
本回答由大雅新科技有限公司提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询