Locker idDbLocker = null;
try {
newDb = new DatabaseImpl(databaseName, newId, envImpl, dbConfig);
/* Insert it into name -> id db. */
nameCursor = new CursorImpl(nameDatabase, nameLocker);
LN nameLN = null;
if (replicatedLN != null) {
nameLN = replicatedLN;
} else {
nameLN = new NameLN(newId, envImpl, newDb.isReplicated());
}
ReplicationContext useRepContext = repContext;
if (repContext == null) {
useRepContext = newDb.getOperationRepContext(CREATE);
}
nameCursor.putLN(databaseName.getBytes("UTF-8"),// key
nameLN,
null, // returnNewData
false, // allowDuplicates
useRepContext);
/*
* If this is a non-handle use, no need to record any handle locks.
*/
if (databaseHandle != null) {
nameLocker.addToHandleMaps(Long.valueOf(nameLN.getNodeId()),
databaseHandle);
}
/* Insert it into id -> name db, in auto commit mode. */
idDbLocker = BasicLocker.createBasicLocker(envImpl);