(EnvironmentParams.NODE_MAX.getName(), "6");
envConfig.setConfigParam(EnvironmentParams.MAX_MEMORY.getName(),
new Long(1 << 24).toString());
envConfig.setTransactional(true);
envConfig.setTxnNoSync(Boolean.getBoolean(TestUtils.NO_SYNC));
env = new Environment(envHome, envConfig);
/*
* Dbs 0 - N1-1 shouldn't exist
* Dbs N1 - N5 should exist
*/
checkForNoDb(dbName1, 0, N1);
checkForDb(dbName1, N1, N5);
/* Remove some dbs, abort */
txn = env.beginTransaction(null, null);
for (int i = N2; i < N4; i++) {
env.removeDatabase(txn, dbName1+i);
}
txn.abort();
/* Remove some dbs, commit */
txn = env.beginTransaction(null, null);
for (int i = N3; i < N4; i++) {
env.removeDatabase(txn, dbName1+i);
}
txn.commit();
/*
* Dbs 0 - N1-1 should not exist
* Dbs N1 - N3-1 should exist
* Dbs N3 - N4-1 should not exist
* Dbs N4 - N5-1 should exist
*/
checkForNoDb(dbName1, 0, N1);
checkForDb(dbName1, N1, N3);
checkForNoDb(dbName1, N3, N4);
checkForDb(dbName1, N4, N5);
/* Close and recover */
env.close();
env = new Environment(envHome, envConfig);
/*
* Dbs 0 - N1-1 should not exist
* Dbs N1 - N3-1 should exist
* Dbs N3 - N4-1 should not exist