开发者社区> 问答> 正文

Druid mysql 查询报错!?报错

@wenshao  最近Druid出现这个问题,在MySQL 下 ,现实环境的用户,数据库连接很小

2013-08-26 10:46:55.104:ERROR:org.hibernate.util.JDBCExceptionReporter:78:loopWaitCount 0, wait millis 60002, active 9

2013-08-26 10:46:56.789:ERROR:org.hibernate.util.JDBCExceptionReporter:78:loopWaitCount 0, wait millis 60012, active 9
2013-08-26 10:46:56.789:ERROR:org.hibernate.util.JDBCExceptionReporter:78:loopWaitCount 0, wait millis 60012, active 9
2013-08-26 10:47:08.739:ERROR:com.netposa.psap.dao.util.BDao:266:查询指定HQL异常,HQL:from Parameter where class_=? and Name=? and value=?
org.springframework.jdbc.UncategorizedSQLException: Hibernate operation: Cannot open connection; uncategorized SQLException for SQL [???]; SQL state [null]; error code [0]; loopWaitCount 0, wait millis 60012, active 9; nested exception is com.alibaba.druid.pool.GetConnectionTimeoutException: loopWaitCount 0, wait millis 60012, active 9
at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.translate(SQLStateSQLExceptionTranslator.java:124)
at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.translate(SQLErrorCodeSQLExceptionTranslator.java:322)
at org.springframework.orm.hibernate3.HibernateAccessor.convertJdbcAccessException(HibernateAccessor.java:424)
at org.springframework.orm.hibernate3.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:410)
at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:424)
at org.springframework.orm.hibernate3.HibernateTemplate.executeWithNativeSession(HibernateTemplate.java:374)
at org.springframework.orm.hibernate3.HibernateTemplate.find(HibernateTemplate.java:917)
at com.netposa.psap.dao.util.BDao.find(BDao.java:264)
at com.netposa.psap.dao.ParameterDAO.SearchOrCreateParameterByClassAndNameAndValue(ParameterDAO.java:410)
at com.netposa.psap.dao.ParameterDAO.getImServerParameter(ParameterDAO.java:376)
at com.netposa.psap.core.UserMngServiceProxy.getImServerParameter(UserMngServiceProxy.java:70)
at com.netposa.psap.core.UserMngServiceProxy$1.run(UserMngServiceProxy.java:94)
Caused by: com.alibaba.druid.pool.GetConnectionTimeoutException: loopWaitCount 0, wait millis 60012, active 9
at com.alibaba.druid.pool.DruidDataSource.pollLast(DruidDataSource.java:1375)
at com.alibaba.druid.pool.DruidDataSource.getConnectionInternal(DruidDataSource.java:1019)
at com.alibaba.druid.pool.DruidDataSource.getConnectionDirect(DruidDataSource.java:902)
at com.alibaba.druid.filter.FilterChainImpl.dataSource_connect(FilterChainImpl.java:4534)
at com.alibaba.druid.filter.stat.StatFilter.dataSource_getConnection(StatFilter.java:661)
at com.alibaba.druid.filter.FilterChainImpl.dataSource_connect(FilterChainImpl.java:4530)
at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:884)
at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:876)
at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:92)
at org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider.getConnection(LocalDataSourceConnectionProvider.java:82)
at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:423)
at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:144)
at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:139)
at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1547)
at org.hibernate.loader.Loader.doQuery(Loader.java:673)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
at org.hibernate.loader.Loader.doList(Loader.java:2220)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104)
at org.hibernate.loader.Loader.list(Loader.java:2099)
at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:378)
at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:338)
at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
at org.springframework.orm.hibernate3.HibernateTemplate$30.doInHibernate(HibernateTemplate.java:926)
at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:419)
... 7 more

展开
收起
爱吃鱼的程序员 2020-06-22 17:13:39 836 0
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB

    应该是sql执行慢,连接不够用

    2020-06-22 17:13:54
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
搭建电商项目架构连接MySQL 立即下载
搭建4层电商项目架构,实战连接MySQL 立即下载
PolarDB MySQL引擎重磅功能及产品能力盛大发布 立即下载

相关镜像