Exemple #1
0
  @Override
  public void reInitialize() throws Exception {
    log.info("Reinitializing repository and connection due to error in past results.");

    if (conn.isOpen()) {
      try {
        log.debug("Trying to close connection, interrupt time is 10000");
        Utils.closeConnectionTimeout(conn, 10000);

      } catch (Exception e) {; /*ignore*/
      }
    }

    if (sailRepo != null) {
      boolean shutDown =
          Utils.shutdownRepositoryTimeout(
              sailRepo, 20 * 60 * 1000); // timeout of 20 min for shutdown
      sailRepo = null;
      if (shutDown) log.debug("Repository shut down.");
      else log.debug("Failed to shut down repository within 20 minutes!");
    }

    //		log.info("Waiting for 2 minutes to give server time for reinitialization");
    //		Thread.sleep(120000);
    log.debug("loading repositories from scratch.");
    System.gc();
    sailRepo = SesameRepositoryLoader.loadRepositories(new VoidReportStream());
    conn = sailRepo.getConnection();
    log.debug("reinitialize done.");
  }
Exemple #2
0
  @Override
  public void initialize() throws Exception {
    log.info("Performing Sesame Initialization...");

    sailRepo = SesameRepositoryLoader.loadRepositories(report);
    if (!Config.getConfig().isFill()) conn = sailRepo.getConnection();

    log.info("Sesame Repository successfully initialized.");
  }