Cannot get a connection, pool error Timeout waiting for idle object

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Cannot get a connection, pool error Timeout waiting for idle object相关的知识,希望对你有一定的参考价值。

Cannot get a connection, pool error Timeout waiting for idle object

异常原因

一直有hibernate的session在开启并偿试打开新连接,导致最终没有空闲链接可用.

PCISV7-VHL [2017-09-07 19:10:13,625]>>>ERROR>>>[ com.isoftstone.fwk.dao.BaseDao.getNewConnection(BaseDao.java:1534) ]-[isoftstone core得到数据连接出错!]  
org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot get a connection, pool error Timeout waiting for idle object
    at org.apache.tomcat.dbcp.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:114)
    at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)
    at com.isoftstone.fwk.dao.BaseDao.getNewConnection(BaseDao.java:1529)
    at com.isoftstone.pcis.policy.prod.base.service.PolicyAppService.insertData(PolicyAppService.java:2970)
    at com.isoftstone.pcis.policy.prod.base.service.PolicyAppService.createPolicy(PolicyAppService.java:933)
    at com.isoftstone.pcis.policy.prod.base.service.PolicyAppService.createPolicyWithBiz(PolicyAppService.java:1969)
    at com.isoftstone.pcis.policy.proxy.prov.payseemoney.PayseemoneyProxyProv.createPolicyWithBiz(PayseemoneyProxyProv.java:57)
    at com.isoftstone.pcis.policy.app.payseemoney.service.PayseemoneyService.generatePlyEdr(PayseemoneyService.java:3278)
    at com.isoftstone.pcis.policy.app.payseemoney.service.PayseemoneyService.finishAllPlyEdrHandle(PayseemoneyService.java:3514)
    at com.isoftstone.pcis.scoket.newbusiness.service.OuterService.insuredConfirms(OuterService.java:1562)
    at com.isoftstone.pcis.scoket.newbusiness.servlet.PayPlatOuterService.doPost(PayPlatOuterService.java:168)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:643)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.springframework.security.util.FilterChainProxy.doFilter(FilterChainProxy.java:168)
    at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:236)
    at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.jasig.cas.client.session.SingleSignOutFilter.doFilter(SingleSignOutFilter.java:99)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at com.isoftstone.iaeap.web.filter.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:99)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:606)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
    at java.lang.Thread.run(Thread.java:662)
Caused by: java.util.NoSuchElementException: Timeout waiting for idle object
    at org.apache.tomcat.dbcp.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:1171)
    at org.apache.tomcat.dbcp.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:106)
    ... 35 more
PCISV7-VHL [2017-09-07 19:10:13,626]>>>ERROR>>>[ com.isoftstone.pcis.policy.prod.base.service.PolicyAppService.insertData(PolicyAppService.java:2987) ]-[插入判断缴费确认是否正常连接车险平台表失败null]  
com.isoftstone.fwk.dao.DaoException
    at com.isoftstone.pcis.policy.prod.base.service.PolicyAppService.insertData(PolicyAppService.java:2988)
    at com.isoftstone.pcis.policy.prod.base.service.PolicyAppService.createPolicy(PolicyAppService.java:933)
    at com.isoftstone.pcis.policy.prod.base.service.PolicyAppService.createPolicyWithBiz(PolicyAppService.java:1969)
    at com.isoftstone.pcis.policy.proxy.prov.payseemoney.PayseemoneyProxyProv.createPolicyWithBiz(PayseemoneyProxyProv.java:57)
    at com.isoftstone.pcis.policy.app.payseemoney.service.PayseemoneyService.generatePlyEdr(PayseemoneyService.java:3278)
    at com.isoftstone.pcis.policy.app.payseemoney.service.PayseemoneyService.finishAllPlyEdrHandle(PayseemoneyService.java:3514)
    at com.isoftstone.pcis.scoket.newbusiness.service.OuterService.insuredConfirms(OuterService.java:1562)
    at com.isoftstone.pcis.scoket.newbusiness.servlet.PayPlatOuterService.doPost(PayPlatOuterService.java:168)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:643)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.springframework.security.util.FilterChainProxy.doFilter(FilterChainProxy.java:168)
    at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:236)
    at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.jasig.cas.client.session.SingleSignOutFilter.doFilter(SingleSignOutFilter.java:99)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at com.isoftstone.iaeap.web.filter.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:99)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:606)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
    at java.lang.Thread.run(Thread.java:662)
PCISV7-VHL [2017-09-07 19:10:13,632]>>>ERROR>>>[ com.isoftstone.pcis.policy.prod.base.service.PolicyAppService.createPolicyWithBiz(PolicyAppService.java:1972) ]-[Line:1971,CAppNO:5994101035520170010031]  
com.isoftstone.fwk.dao.DaoException
    at com.isoftstone.pcis.policy.prod.base.service.PolicyAppService.insertData(PolicyAppService.java:2988)
    at com.isoftstone.pcis.policy.prod.base.service.PolicyAppService.createPolicy(PolicyAppService.java:933)
    at com.isoftstone.pcis.policy.prod.base.service.PolicyAppService.createPolicyWithBiz(PolicyAppService.java:1969)
    at com.isoftstone.pcis.policy.proxy.prov.payseemoney.PayseemoneyProxyProv.createPolicyWithBiz(PayseemoneyProxyProv.java:57)
    at com.isoftstone.pcis.policy.app.payseemoney.service.PayseemoneyService.generatePlyEdr(PayseemoneyService.java:3278)
    at com.isoftstone.pcis.policy.app.payseemoney.service.PayseemoneyService.finishAllPlyEdrHandle(PayseemoneyService.java:3514)
    at com.isoftstone.pcis.scoket.newbusiness.service.OuterService.insuredConfirms(OuterService.java:1562)
    at com.isoftstone.pcis.scoket.newbusiness.servlet.PayPlatOuterService.doPost(PayPlatOuterService.java:168)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:643)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.springframework.security.util.FilterChainProxy.doFilter(FilterChainProxy.java:168)
    at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:236)
    at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.jasig.cas.client.session.SingleSignOutFilter.doFilter(SingleSignOutFilter.java:99)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at com.isoftstone.iaeap.web.filter.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:99)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:606)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
    at java.lang.Thread.run(Thread.java:662)
PCISV7-VHL [2017-09-07 19:10:13,635]>>>ERROR>>>[ com.isoftstone.pcis.policy.app.payseemoney.service.PayseemoneyService.finishAllPlyEdrHandle(PayseemoneyService.java:3594) ]-[CAppNo:5994101035520170010031]  
java.lang.NullPointerException
    at com.isoftstone.pcis.policy.app.payseemoney.service.PayseemoneyService.generatePlyEdr(PayseemoneyService.java:3292)
    at com.isoftstone.pcis.policy.app.payseemoney.service.PayseemoneyService.finishAllPlyEdrHandle(PayseemoneyService.java:3514)
    at com.isoftstone.pcis.scoket.newbusiness.service.OuterService.insuredConfirms(OuterService.java:1562)
    at com.isoftstone.pcis.scoket.newbusiness.servlet.PayPlatOuterService.doPost(PayPlatOuterService.java:168)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:643)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.springframework.security.util.FilterChainProxy.doFilter(FilterChainProxy.java:168)
    at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:236)
    at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.jasig.cas.client.session.SingleSignOutFilter.doFilter(SingleSignOutFilter.java:99)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at com.isoftstone.iaeap.web.filter.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:99)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:606)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
    at java.lang.Thread.run(Thread.java:662)
PCISV7-VHL [2017-09-07 19:10:13,642]>>>INFO>>>[ com.isoftstone.pcis.policy.app.payseemoney.utils.DaoFactoryMod.rollbackCurrentTransaction(DaoFactoryMod.java:373) ]-[在DaoFactoryMod中数据库连接已经关闭成功!]  
java.lang.NullPointerException
    at com.isoftstone.pcis.policy.app.payseemoney.service.PayseemoneyService.generatePlyEdr(PayseemoneyService.java:3292)
    at com.isoftstone.pcis.policy.app.payseemoney.service.PayseemoneyService.finishAllPlyEdrHandle(PayseemoneyService.java:3514)
    at com.isoftstone.pcis.scoket.newbusiness.service.OuterService.insuredConfirms(OuterService.java:1562)
    at com.isoftstone.pcis.scoket.newbusiness.servlet.PayPlatOuterService.doPost(PayPlatOuterService.java:168)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:643)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.springframework.security.util.FilterChainProxy.doFilter(FilterChainProxy.java:168)
    at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:236)
    at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.jasig.cas.client.session.SingleSignOutFilter.doFilter(SingleSignOutFilter.java:99)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at com.isoftstone.iaeap.web.filter.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:99)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:606)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
    at java.lang.Thread.run(Thread.java:662)
PCISV7-VHL [2017-09-07 19:10:13,646]>>>ERROR>>>[ com.isoftstone.pcis.scoket.newbusiness.service.OuterService.insuredConfirms(OuterService.java:1607) ]-[CAppNo:5994101035520170010031]  
java.lang.NullPointerException
    at com.isoftstone.pcis.policy.app.payseemoney.service.PayseemoneyService.generatePlyEdr(PayseemoneyService.java:3292)
    at com.isoftstone.pcis.policy.app.payseemoney.service.PayseemoneyService.finishAllPlyEdrHandle(PayseemoneyService.java:3514)
    at com.isoftstone.pcis.scoket.newbusiness.service.OuterService.insuredConfirms(OuterService.java:1562)
    at com.isoftstone.pcis.scoket.newbusiness.servlet.PayPlatOuterService.doPost(PayPlatOuterService.java:168)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:643)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.springframework.security.util.FilterChainProxy.doFilter(FilterChainProxy.java:168)
    at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:236)
    at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.jasig.cas.client.session.SingleSignOutFilter.doFilter(SingleSignOutFilter.java:99)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at com.isoftstone.iaeap.web.filter.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:99)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:606)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
    at java.lang.Thread.run(Thread.java:662)
PCISV7-VHL [2017-09-07 19:10:13,652]>>>INFO>>>[ com.isoftstone.pcis.scoket.newbusiness.servlet.PayPlatOuterService.doPost(PayPlatOuterService.java:179) ]-[支付平台回写接口执行完成时间:11.204秒]  
PCISV7-VHL [2017-09-07 19:10:13,653]>>>INFO>>>[ com.isoftstone.pcis.scoket.newbusiness.servlet.PayPlatOuterService.doPost(PayPlatOuterService.java:180) ]-[支付平台回写接口响应报文:

 

解决方案

在this.getSession()之后,用完就关掉这个this.getSession().close() ,

因为不close()的话,一个session会一直占用着它拥有的那个连接,于是该连接再也无法被其它新session使用,最终导致数据库的连接用被尽.

GetPendingCallbackDataDaoImpl.java类中代码

try {
//            PreparedStatement prepStmt = SpringUtils.getCommonDao().getCurrentConnection().prepareStatement(sql.toString());
//            SQLQuery query = SpringUtils.getCommonDao().getSessionFactory().openSession().createSQLQuery(sql.toString());
            SQLQuery query = this.getSession().createSQLQuery(sql.toString());
            for (int i = 0; i < parameters.size(); i++)
                query.setString(i, parameters.get(i));
            for (String column : QUERY_COLUMNS)
                query.addScalar(column, Hibernate.STRING);
            query.setResultTransformer(Transformers.ALIAS_TO_ENTITY_MAP);
            return query.list();
        } catch (Exception e) {
            throw new BusinessServiceException(e);
        }finally{
            this.getSession().close();
        }

 

以上是关于Cannot get a connection, pool error Timeout waiting for idle object的主要内容,如果未能解决你的问题,请参考以下文章

zabbix提示zabbix server is not running &Get value from agent failed: cannot connect to

Get value from agent failed: cannot connect to [[127.0.0.1]:10050]: [111] Connection refused

小记:Windows redis引发的一场血案(Cannot get Jedis connection&&java.util.NoSuchElementException Unable

zabbix: Get value from agent failed: cannot connect to [[172.16.179.10]:10050]: [4] Interrupted syst

redis使用问题一:Cannot get Jedis connection; nested exception is redis.clients.jedis.exceptions.JedisExce

zabbix Get value from agent failed: cannot connect to [[10.2.72.132]:10050]: [113] No route to host