Esempio n. 1
0
File: DB.java Progetto: rhauch/MapDB
 /**
  * Closes database. All other methods will throw 'IllegalAccessError' after this method was
  * called.
  *
  * <p>!! it is necessary to call this method before JVM exits!!
  */
 public synchronized void close() {
   if (engine == null) return;
   engine.close();
   // dereference db to prevent memory leaks
   engine = null;
   collections = null;
   defaultSerializer = null;
 }
Esempio n. 2
0
 /**
  * Closes database. All other methods will throw 'IllegalAccessError' after this method was
  * called.
  *
  * <p>!! it is necessary to call this method before JVM exits!!
  */
 public synchronized void close() {
   if (engine == null) return;
   engine.close();
   // dereference db to prevent memory leaks
   engine = null;
   namesInstanciated = null;
   namesLookup = null;
 }
Esempio n. 3
0
 /** constructs DB using current settings */
 public DB make() {
   boolean strictGet = propsGetBool(Keys.strictDBGet);
   Engine engine = makeEngine();
   boolean dbCreated = false;
   try {
     DB db = new DB(engine, strictGet);
     dbCreated = true;
     return db;
   } finally {
     // did db creation fail? in that case close engine to unlock files
     if (!dbCreated) engine.close();
   }
 }