日期:2014-05-19  浏览次数:21132 次

xapool连接池不释放连接的问题。。。
公司一个项目跑了几个星期之后 就爆掉啦,查了一下日志如下:

SQLException in StandardPoolDataSource:getConnection exception: 
java.sql.SQLException
SQLException in StandardPoolDataSource:getConnection no connection available 
java.lang.Exception: GenericPool:checkOut ERROR impossible to obtain a new object from the pool

StandardXADataSource:
  connection count=<200>
  number of dead connection=<0>
  dead lock max wait=<300000>
  dead lock retry wait=<10000>
  driver=<oracle.jdbc.driver.OracleDriver@1c5d81c>
  driver name=<oracle.jdbc.driver.OracleDriver>
  number of *free* connections=<199>
  max con=<0>
  min con=<50>
  prepared stmt cache size=<16>
  transaction manager=<org.objectweb.jotm.Current@8bf223>
  xid connection size=<1>
StandardConnectionPoolDataSource:
  master prepared stmt cache size=<200>
  prepared stmt cache size =<16>
StandardDataSource:
  driver=<oracle.jdbc.driver.OracleDriver@1c5d81c>
  url=<jdbc:oracle:thin:@127.0.0.1:1521:trp>
  user=<null>
CoreDataSource :
  debug =<false>
  description =<null>
  login time out =<0>
  user =<null>
  verbose =<false>
StandardPoolDataSource:
  data source name=<null>
  jdbc test stmt=<null>
  user=<slql>
GenericPool:
  num of element =<200>
  minSize =<5>
  maxSize =<200>
  lifeTime =<600000>
  ngeneration =<1>
  maxLifeTime =<0>
  getLockedObjectCount() =<200>
  getUnlockedObjectCount() =<0>
  getDeadLockMaxWait() =<300000>
  getDeadLockRetryWait() =<10000>
Unlocked pool:
Locked pool:

网上有人说是oracle9i问题,Oracle9i有名的内存溢出bug导致:Xapool对PreparedStatement进行了Cache,同时Oracle 有一个出名的内存漏洞,PreparedStatement使用之后必须关闭,如果不关闭连续进行SQL查询会造成前面SQL的游标不能释放;

可是这个项目用的是oracle 10g

有没有人遇到过类似的问题 给点建议

------解决方案--------------------
我也碰到这个问题,用的oracle10g,正在寻找解决方案