return env;
}
public static Db open(DbEnv environment, String name, boolean isQueue) throws FileNotFoundException, DbException, JMSException {
int flags = Db.DB_CREATE; // | Db.DB_AUTO_COMMIT
Db db = new Db(environment, 0);
if (isQueue) {
db.setFlags(Db.DB_RENUMBER);
}
// only use Db.DB_RECNUM for list tables as its a performance hog
int type = Db.DB_BTREE;
if (isQueue) {
type = Db.DB_RECNO;
}
String databaseName = null;
DbTxn transaction = createTransaction(environment);
try {
db.open(transaction, name, databaseName, type, flags, 0);
transaction = commitTransaction(transaction);
}
finally {
rollbackTransaction(transaction);
}