clcommon/src/main/java/thredds/inventory/bdb/MetadataManager.java
static synchronized public void closeAll() {

    List<MetadataManager> closeDatabases = new ArrayList<>(openDatabases);
    for (MetadataManager mm : closeDatabases) {
      if (debug) System.out.println("  close database " + mm.collectionName);
      mm.close();
    }
    openDatabases = new ArrayList<>(); // empty

    if (myEnv != null) {
      try {
        // Finally, close the store and environment.
        myEnv.close();
        myEnv = null;
        logger.info("closed bdb caching");

      } catch (DatabaseException dbe) {
        logger.error("Error closing bdb: ", dbe);
      }
    }
  }
static synchronized public void closeAll() {

    List<MetadataManager> closeDatabases = new ArrayList<>(openDatabases);
    for (MetadataManager mm : closeDatabases) {
      if (debug) System.out.println("  close database " + mm.collectionName);
      mm.close();
    }
    openDatabases = new ArrayList<>(); // empty

    if (myEnv != null) {
      try {
        // Finally, close the store and environment.
        myEnv.close();
        myEnv = null;
        logger.info("closed bdb caching");

      } catch (DatabaseException dbe) {
        logger.error("Error closing bdb: ", dbe);
      }
    }
  }
this is called on TDS shutdown and reinit