连接池超过最大连接数问题

ershihaidao 2012-09-11 05:40:25
[9/11/12 14:26:23:860 CST] 000000aa SystemOut O 1981-09-28
[9/11/12 14:26:23:860 CST] 000000aa SystemOut O
[9/11/12 14:26:23:860 CST] 000000aa SystemOut O aaaa=5按机构查询客户与操作员信息==select p.cifno,p.cifname,p.idnum,p.mangno,t.name from cr_personinfo p left JOIN cms_tlrctl t on p.mangno=t.tlrno where p.delstat='0' and p.stat <='2' and length(p.cifno)>=10 and p.canalno = '09903' and rownum<21 and p.cifname like '%董红霞%' union all select p.cifno,p.cifname,p.license,p.mangno,t.name from cr_corp_inf p left JOIN cms_tlrctl t on p.mangno=t.tlrno where p.delstat='0' and p.stat <='2' and length(p.cifno)>=10 and p.canalno = '09903' and rownum<21 and p.cifname like '%董红霞%'
[9/11/12 14:26:27:806 CST] 00000017 GenericDataSo I org.apache.struts.legacy.GenericDataSource getConnection getConnection()
[9/11/12 14:26:27:818 CST] 00000017 GenericDataSo I org.apache.struts.legacy.GenericDataSource getConnection Check for timeout, activeCount=500, useCount=500
[9/11/12 14:26:27:836 CST] 00000017 GenericDataSo I org.apache.struts.legacy.GenericDataSource getConnection Sleep until next test
[9/11/12 14:26:28:854 CST] 00000017 GenericDataSo I org.apache.struts.legacy.GenericDataSource getConnection Check for timeout, activeCount=500, useCount=500
[9/11/12 14:26:28:865 CST] 00000017 GenericDataSo I org.apache.struts.legacy.GenericDataSource getConnection Sleep until next test
[9/11/12 14:26:29:885 CST] 00000017 GenericDataSo I org.apache.struts.legacy.GenericDataSource getConnection Check for timeout, activeCount=500, useCount=500
[9/11/12 14:26:29:909 CST] 00000017 GenericDataSo I org.apache.struts.legacy.GenericDataSource getConnection Sleep until next test


数据库为aix,was为websphere
今天出现两次由于超过最大连接池导致项目无法登陆,有一次还导致websphere宕掉。
求解决方法?由于程序比较乱,而且是很多人都参与开发过?无法定位具体是由于什么原因导致的?
我猜想有两种可能:1、是在访问了数据库没有释放链接所致,但功能模块太多,无法定位具体是那个模块?
2、由于是中毒引起,因为该情况以前从来没有出现过,项目上线都半年了,今天才暴露这个问题。
求高手帮忙解决一下?
比如怎么定位错误?有什么命令可以定位具体是什么链接没有释放等等?
...全文
511 5 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
flyoversky 2012-09-12
  • 打赏
  • 举报
回复
两个可能性比较大
1.数据连接没有及时关闭,产生泄漏
2.sql效率比较低,执行时间超长造成了连接不能及时释放
龙四 2012-09-12
  • 打赏
  • 举报
回复
多半是数据库连接没有释放,有个叫BTrace的东西据说可以跟踪
coolbamboo2008 2012-09-12
  • 打赏
  • 举报
回复
有的时候连接池的延时时间可以调的高一点,会好一点的。多的和楼上的仁兄说的差不多
coolbamboo2008 2012-09-12
  • 打赏
  • 举报
回复
有的时候连接池的延时时间可以调的高一点,会好一点的。多的和楼上的仁兄说的差不多
MiceRice 2012-09-11
  • 打赏
  • 举报
回复
数据库是AIX?你是想说: DB2 吧?

争取从数据库层面,抓取各Connection最后执行的SQL是啥,从而定位看是哪个模块可能没有关闭连接。

另外还有就是看看是否有超长时间执行的SQL,也许是某些SQL卡住了。

中毒概率很低,尤其是你还是AIX系统。。。

67,549

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧