public void updateArchiveEODForSymbol(final String scrip) throws Exception {

    final IScripSvc eodScripSvc = ServiceMgr.getScripSvc();
    final List<ScripEOD> activeEOD = eodScripSvc.getArchivedEODData(scrip);
    double lastClosing = -1;
    for (final ScripEOD eod : activeEOD) {
      if (lastClosing != -1) {
        eod.setPrevClosePrice(lastClosing);
      }
      lastClosing = eod.getClosingPrice();
    }

    final IEODIndexDAO dao = (IEODIndexDAO) OF.getBean("EODIndexDAO");
    dao.updateArchive(activeEOD);
  }
  public void updateActiveEOD() throws Exception {

    final ISymbolDAO symbDAO = (ISymbolDAO) OF.getBean("SymbolDAO");
    final Map<String, Symbol> symbMap = symbDAO.getAllSymbolsMap();

    int i = 0;
    for (final String symbol : symbMap.keySet()) {
      logger.debug(symbMap.size() - i + " left. Updating Active symbol = " + symbol);
      updateActiveEODForSymbol(symbol);
      i++;
    }

    i = 0;
    for (final String symbol : symbMap.keySet()) {
      logger.debug(symbMap.size() - i + " left. Updating Archive symbol = " + symbol);
      updateArchiveEODForSymbol(symbol);
      i++;
    }
  }