assert ln != null;
assert putMode != null;
assert putMode != PutMode.CURRENT;
Locker nextKeyLocker = null;
CursorImpl nextKeyCursor = null;
try {
/* If other transactions are serializable, lock the next key. */
Locker cursorLocker = cursorImpl.getLocker();
if (dbImpl.getDbEnvironment().
getTxnManager().
areOtherSerializableTransactionsActive(cursorLocker)) {
nextKeyLocker = BuddyLocker.createBuddyLocker
(dbImpl.getDbEnvironment(), cursorLocker);
nextKeyCursor = new CursorImpl(dbImpl, nextKeyLocker);
/* Perform eviction for user cursors. */
nextKeyCursor.setAllowEviction(true);
nextKeyCursor.lockNextKeyForInsert(key);
}
/* Perform the put operation. */
return putAllowPhantoms
(key, data, ln, putMode, returnOldData, returnNewData,
nextKeyCursor, repContext);
} finally {
/* Release the next-key lock. */
if (nextKeyCursor != null) {
nextKeyCursor.close();
}
if (nextKeyLocker != null) {
nextKeyLocker.operationEnd();
}
}