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 閱讀(252) 評論(0)  編輯  收藏

          只有注冊用戶登錄后才能發表評論。


          網站導航:
           
           
          主站蜘蛛池模板: 乌鲁木齐县| 泽库县| 武宁县| 满城县| 湟中县| 乌拉特前旗| 香港| 桂阳县| 育儿| 克山县| 东辽县| 上栗县| 淅川县| 峨边| 恭城| 玛曲县| 巴青县| 濮阳县| 松江区| 巩留县| 阳江市| 阳谷县| 凉城县| 平凉市| 衡阳县| 孟村| 巨野县| 读书| 铁岭县| 奉节县| 柏乡县| 连江县| 邢台市| 穆棱市| 新建县| 平和县| 临颍县| 广水市| 阳西县| 临桂县| 罗江县|