public void closeAllNavigators() {

    if (resultMap == null) {
      return;
    }

    Iterator it = resultMap.values().iterator();

    while (it.hasNext()) {
      Result result = (Result) it.next();

      result.getNavigator().close();
    }

    resultMap.clear();
  }
  // result
  Result getDataResultHead(Result command, Result result, boolean isNetwork) {

    int fetchSize = command.getFetchSize();

    result.setResultId(session.actionTimestamp);

    if (command.rsConcurrency == ResultConstants.CONCUR_READ_ONLY) {
      result.setDataResultConcurrency(ResultConstants.CONCUR_READ_ONLY);
      result.setDataResultHoldability(command.rsHoldability);
    } else {
      if (result.rsConcurrency == ResultConstants.CONCUR_READ_ONLY) {
        result.setDataResultHoldability(command.rsHoldability);

        // add warning for concurrency conflict
      } else {
        if (session.isAutoCommit()) {
          result.setDataResultConcurrency(ResultConstants.CONCUR_READ_ONLY);
          result.setDataResultHoldability(ResultConstants.HOLD_CURSORS_OVER_COMMIT);
        } else {
          result.setDataResultHoldability(ResultConstants.CLOSE_CURSORS_AT_COMMIT);
        }
      }
    }

    result.setDataResultScrollability(command.rsScrollability);

    boolean hold = false;
    boolean copy = false;

    if (result.rsConcurrency == ResultConstants.CONCUR_UPDATABLE) {
      hold = true;
    }

    if (isNetwork) {
      if (fetchSize != 0 && result.getNavigator().getSize() > fetchSize) {
        copy = true;
        hold = true;
      }
    } else {
      if (result.getNavigator().isDiskBased()) {
        hold = true;
      }
    }

    if (hold) {
      if (resultMap == null) {
        resultMap = new LongKeyHashMap();
      }

      resultMap.put(result.getResultId(), result);
    }

    if (copy) {
      result = Result.newDataHeadResult(session, result, 0, fetchSize);
    }

    return result;
  }
  public void closeAllTransactionNavigators() {

    if (resultMap == null) {
      return;
    }

    Iterator it = resultMap.values().iterator();

    while (it.hasNext()) {
      Result result = (Result) it.next();

      if (result.rsHoldability == ResultConstants.CLOSE_CURSORS_AT_COMMIT) {
        result.getNavigator().close();
        it.remove();
      }
    }

    resultMap.clear();
  }
  RowSetNavigatorClient getRowSetSlice(long id, int offset, int count) {

    Result result = (Result) resultMap.get(id);
    RowSetNavigator source = result.getNavigator();

    if (offset + count > source.getSize()) {
      count = source.getSize() - offset;
    }

    return new RowSetNavigatorClient(source, offset, count);
  }
  public void closeNavigator(long id) {

    Result result = (Result) resultMap.remove(id);

    result.getNavigator().close();
  }
  Result getDataResult(long id) {

    Result result = (Result) resultMap.get(id);

    return result;
  }