Exemple #1
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;
   collections = null;
   defaultSerializer = null;
 }
Exemple #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;
 }
 /** 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();
   }
 }