/** write all data to disk */
 public void commit() {
   synchronized (db) {
     if (!db.isClosed()) {
       db.commit();
     }
   }
 }
Пример #2
0
 /** Clears the database on the computer and resets it. */
 public void clearAndResetMap() {
   if (database != null && !database.isClosed()) {
     replaceClassLoader();
     database.delete(INTERVALS);
     database.commit();
     resetOldClassLoader();
     set = createSet();
   }
 }
Пример #3
0
 /**
  * Properly close the database. Note: The database should be ACID even when not properly closed.
  */
 public void closeDatabase() {
   if (database != null && !database.isClosed()) {
     replaceClassLoader();
     database.close();
     resetOldClassLoader();
   }
   isClosed = true;
   resetOldClassLoader();
 }
 /** write all data to disk and close db */
 public void close() {
   synchronized (db) {
     if (!db.isClosed()) {
       log.info("commit...");
       db.commit();
       log.info("close...");
       db.close();
       log.trace("closed");
     }
   }
 }