public static Database setupDatabase(boolean readOnly, String dbName, Bdb bdb) throws IOException, DatabaseException { DatabaseConfig dbConfig = new DatabaseConfig(); dbConfig.setReadOnly(readOnly); dbConfig.setAllowCreate(!readOnly); dbConfig.setDeferredWrite(!readOnly); return bdb.bdbEnv.openDatabase(null, dbName, dbConfig); }
public WorkQueues(Environment env, String dbName, boolean resumable) throws DatabaseException { this.env = env; this.resumable = resumable; DatabaseConfig dbConfig = new DatabaseConfig(); dbConfig.setAllowCreate(true); dbConfig.setTransactional(resumable); dbConfig.setDeferredWrite(!resumable); urlsDB = env.openDatabase(null, dbName, dbConfig); webURLBinding = new WebURLTupleBinding(); }