synchronized void closeResultCache() {

    if (resultCache != null) {
      try {
        resultCache.close(false);
      } catch (HsqlException e) {
      }

      resultCache = null;
    }
  }
  public DataFileCacheSession getResultCache() {

    if (resultCache == null) {
      String path = database.getTempDirectoryPath();

      if (path == null) {
        return null;
      }

      try {
        resultCache =
            new DataFileCacheSession(database, path + "/session_" + Long.toString(session.getId()));

        resultCache.open(false);
      } catch (Throwable t) {
        return null;
      }
    }

    return resultCache;
  }