[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、由于是中毒引起,因为该情况以前从来没有出现过,项目上线都半年了,今天才暴露这个问题。
求高手帮忙解决一下?
比如怎么定位错误?有什么命令可以定位具体是什么链接没有释放等等?

解决方案 »

  1.   

    数据库是AIX?你是想说: DB2 吧?争取从数据库层面,抓取各Connection最后执行的SQL是啥,从而定位看是哪个模块可能没有关闭连接。另外还有就是看看是否有超长时间执行的SQL,也许是某些SQL卡住了。中毒概率很低,尤其是你还是AIX系统
      

  2.   

    多半是数据库连接没有释放,有个叫BTrace的东西据说可以跟踪
      

  3.   

    两个可能性比较大
    1.数据连接没有及时关闭,产生泄漏
    2.sql效率比较低,执行时间超长造成了连接不能及时释放