示例#1
0
  public void terminate() throws DatabaseException {
    /* Wait for checkpoint and log archive threads to finish. */
    try {
      lgaThr.join();
      ckpThr.join();
    } catch (Exception e1) {
      System.err.println("Support thread join failed.");
    }

    /*
     * We have used the DB_TXN_NOSYNC environment flag for improved
     * performance without the usual sacrifice of transactional durability,
     * as discussed in the "Transactional guarantees" page of the Reference
     * Guide: if one replication site crashes, we can expect the data to
     * exist at another site.  However, in case we shut down all sites
     * gracefully, we push out the end of the log here so that the most
     * recent transactions don't mysteriously disappear.
     */
    dbenv.logFlush(null);

    dbenv.close();
  }