业务偶尔出现无法获取连接,导致更新订单状态失败的问题
经过查询,是tomcat自带的数据库连接池xapool 1.5
版本存在该bug,会偶尔出现获取连接报空指针导致获取连接失败的问题。
异常内容如下:
2017-08-0513:02:33,571 INFO [pool-3-thread-5] DbApi.getConnection(598) | Get DbConnectionerror. jndiPoolNo=A ErrorMessage=java.sql.SQLException: SQLException inStandardPoolDataSource:getConnection exception: java.sql.SQLException:SQLException in StandardPoolDataSource:getConnection no connection availablejava.lang.NullPointerException
java.sql.SQLException:SQLException in StandardPoolDataSource:getConnection exception:java.sql.SQLException: SQLException in StandardPoolDataSource:getConnection noconnection available java.lang.NullPointerException
atorg.enhydra.jdbc.pool.StandardPoolDataSource.getConnection(StandardPoolDataSource.java:213)
atorg.enhydra.jdbc.pool.StandardPoolDataSource.getConnection(StandardPoolDataSource.java:164)
atcom.hispeed.dbApi.DbApi.getConnection(DbApi.java:588)
at com.hispeed.dbApi.DbApi.caculateConn(DbApi.java:883)
at com.hispeed.dbApi.DbApi.execProcess(DbApi.java:216)
at com.hispeed.dao.impl.AliOrderQueryDao.updateOrderQueryStatusAfter(AliOrderQueryDao.java:82)
atcom.hispeed.thread.AliOrderQueryConsumer.consume(AliOrderQueryConsumer.java:152)
atcom.hispeed.thread.AliOrderQueryConsumer.consume(AliOrderQueryConsumer.java:1)
at com.hispeed.producerConsumer.distinct.DistinctConsumer.run(DistinctConsumer.java:74)
atjava.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
atjava.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
2017-08-05 13:02:33,572INFO [pool-3-thread-5] DbApi.getConnection(599) | errorcode=DB11111mess="new dbbean get dbpool err |A"
若有使用该版本的xapool,尽快更新附件版本1.6