code: public boolean closeLog(int closemode) {
  
          if (log == null) {
              return true;
          }
  
          try {
              switch (closemode) {
  
                  case Database.CLOSEMODE_IMMEDIATELY :
                      log.shutdown();
                      break;
  
                  case Database.CLOSEMODE_NORMAL :
                      log.close(false);
                      break;
  
                  case Database.CLOSEMODE_COMPACT :
                  case Database.CLOSEMODE_SCRIPT :
                      log.close(true);
                      break;
              }
          } catch (Throwable e) {
              appLog.logContext(e, "error closing log");
              appLog.close();
  
              log = null;
  
              return false;
          }
  
          appLog.sendLine(SimpleLog.LOG_ERROR, "Database closed");
          appLog.close();
  
          log = null;
  
          return true;
      }
docs: Shuts down the logging process using the specified mode. <p>
  
  @param  closemode The mode in which to shut down the logging
  process
  <OL>
  <LI> closemode -1 performs SHUTDOWN IMMEDIATELY, equivalent
  to  a poweroff or crash.
  <LI> closemode 0 performs a normal SHUTDOWN that
  checkpoints the database normally.
  <LI> closemode 1 performs a shutdown compact that scripts
  out the contents of any CACHED tables to the log then
  deletes the existing *.data file that contains the data
  for all CACHED table before the normal checkpoint process
  which in turn creates a new, compact *.data file.
  <LI> closemode 2 performs a SHUTDOWN SCRIPT.
  </OL>
  
  @return  true if closed with no problems or false if a problem was
  encountered.