//*-- check for errors and open the environment
if ( (dbname.equals("")) || (!(existsDB(dbname))) ) return false;
if (env != null) { openEnv(DBDIR, readOnly); if (env == null) return false; }
//*-- create the primary database handle
DatabaseConfig dbconfig = new DatabaseConfig();
dbconfig.setAllowCreate(false); //*-- disallow creation of database
dbconfig.setSortedDuplicates(dupFlag); //*-- flag for dups
dbconfig.setExclusiveCreate(readOnly); //*-- allow opening of an existing database
dbconfig.setReadOnly(readOnly); //*-- set r/w status of the database
// dbconfig.setTransactional(true);
currentDB = env.openDatabase(null, dbname, dbconfig);
dbMap.put(dbname, currentDB );
}
catch (DatabaseException dbe) { logger.error("Failed to open DB " + dbname + " " + dbe.getMessage() ); return false; }