Dev Zone
偏执狂才能生存,人生/事业的路上需要再坚持一下
但是又怎么说得清坚持的结果,道得尽坚持的含义
现状:XAPool1.4有一个bug,当设置preparedStmtCacheSize=0的时候,关闭连接会抛出NullPointerException
 
原因:StandardConnectionHandle在Close的时候调用了preparedStatementCache.cleanupAll(),没有进行判断;而当preparedStmtCacheSize设置为0的时候,StandardConnectionHandle在setupPreparedStatementCache中把preparedStatementCache设置为null,以下setupPreparedStatementCache是方法中的源代码片断:
 
 protected void setupPreparedStatementCache() {
  log.debug(
"StandardConnectionHandle:setupPreparedStatementCache start");
  
if (preparedStmtCacheSize == 0) {
   log.debug(
    
"StandardConnectionHandle:setupPreparedStatementCache return with 0");
   preparedStatementCache 
= null;
   
return;
  }
 
解决办法:修改setupPreparedStatementCache,如下:
  if (preparedStmtCacheSize == 0) {
   log.debug(
    
"StandardConnectionHandle:setupPreparedStatementCache return with 0");
//   preparedStatementCache = null;
   preparedStatementCache = new PreparedStatementCache(0);
   
return;
  }
posted on 2005-05-17 22:05 dev 阅读(244) 评论(0)  编辑  收藏

只有注册用户登录后才能发表评论。


网站导航: