long oldLsn,
Locker locker)
throws DatabaseException {
makeDeleted();
EnvironmentImpl env = database.getDbEnvironment();
long newLsn = DbLsn.NULL_LSN;
if (dupKey != null) {
/*
* Deleted Duplicate LNs are logged with two keys -- the one that
* identifies the main tree (the dup key) and the one that places
* them in the duplicate tree (really the data) since we can't
* recreate the latter because the data field has been nulled. Note
* that the dupKey is passed to the log manager FIRST, because the
* dup key is the one that navigates us in the main tree. The "key"
* is the one that navigates us in the duplicate tree. Also, we
* must check if this is a transactional entry that must be rolled
* back or one done on the behalf of a null txn.
*/
LogEntryType entryType;
long logAbortLsn;
boolean logAbortKnownDeleted;
Txn logTxn;
if (locker.isTransactional()) {
entryType = LogEntryType.LOG_DEL_DUPLN_TRANSACTIONAL;
logAbortLsn = locker.getAbortLsn(getNodeId());
logAbortKnownDeleted =
locker.getAbortKnownDeleted(getNodeId());
logTxn = locker.getTxnLocker();
} else {
entryType = LogEntryType.LOG_DEL_DUPLN;
logAbortLsn = DbLsn.NULL_LSN;
logAbortKnownDeleted = true;
logTxn = null;
}
/* Don't count abortLsn as obsolete, this is done during commit. */
if (oldLsn == logAbortLsn) {
oldLsn = DbLsn.NULL_LSN;
}
DeletedDupLNLogEntry logEntry =
new DeletedDupLNLogEntry(entryType,
this,
database.getId(),
dupKey,
lnKey,
logAbortLsn,
logAbortKnownDeleted,
logTxn);
LogManager logManager = env.getLogManager();
newLsn = logManager.log(logEntry, false, oldLsn);
} else {
/*