}
db = database;
try {
currentTxn =
CurrentTransaction.getInstanceInternal(db.getEnvironment());
DatabaseConfig dbConfig;
if (db instanceof SecondaryDatabase) {
secDb = (SecondaryDatabase) database;
SecondaryConfig secConfig = secDb.getSecondaryConfig();
secKeyCreator = secConfig.getKeyCreator();
dbConfig = secConfig;
} else {
dbConfig = db.getConfig();
}
ordered = !DbCompat.isTypeHash(dbConfig);
recNumAllowed = DbCompat.isTypeQueue(dbConfig) ||
DbCompat.isTypeRecno(dbConfig) ||
DbCompat.getBtreeRecordNumbers(dbConfig);
recNumRenumber = DbCompat.getRenumbering(dbConfig);
dupsAllowed = DbCompat.getSortedDuplicates(dbConfig) ||
DbCompat.getUnsortedDuplicates(dbConfig);
dupsOrdered = DbCompat.getSortedDuplicates(dbConfig);
transactional = currentTxn.isTxnMode() &&
dbConfig.getTransactional();
readUncommittedAllowed = DbCompat.getReadUncommitted(dbConfig);
btreeRecNumDb = recNumAllowed && DbCompat.isTypeBtree(dbConfig);
range = new KeyRange(dbConfig.getBtreeComparator());
} catch (DatabaseException e) {
throw new RuntimeExceptionWrapper(e);
}
this.writeAllowed = writeAllowed;
this.keyBinding = keyBinding;