dbEnvConfig.setLockTimeout(5, TimeUnit.SECONDS);
environment = new Environment(dir, dbEnvConfig);
final DatabaseConfig dbConfig = new DatabaseConfig();
dbConfig.setTransactional(true);
dbConfig.setAllowCreate(true);
database = environment.openDatabase(null, name, dbConfig);
} catch (final Exception ex) {
LOGGER.error("Could not create FlumePersistentManager", ex);
// For consistency, close database as well as environment even though it should never happen since the
// database is that last thing in the block above, but this does guard against a future line being
// inserted at the end that would bomb (like some debug logging).