/*
* Save a reference to the affected parent of this LN to place on
* the delete info queue when the txn commits. If this is a
* duplicate tree, we also have to update the duplicate tree count.
*/
ChildReference dupCountRef = dupRoot.getDupCountLNRef();
DupCountLN dcl = (DupCountLN)
dupCountRef.fetchTarget(database, dupRoot);
dupRoot.releaseLatch();
LockResult dclGrantAndInfo = locker.lock
(dcl.getNodeId(), LockType.WRITE, database);
/*
* The write lock request might have blocked while waiting for a
* transaction that changed the oldLsn. Re-get the reference to
* the LN and get the old (abort) LSN out of it.
*/
latchBIN();
dupRoot = (DIN) bin.fetchTarget(index);
dupRoot.latch();
releaseBIN();
dupCountRef = dupRoot.getDupCountLNRef();
long oldDclLsn = dupCountRef.getLsn();
dclGrantAndInfo.setAbortLsn(oldDclLsn,
dupCountRef.isKnownDeleted());
dcl = (DupCountLN) dupCountRef.fetchTarget(database, dupRoot);
dcl.decDupCount();
assert dcl.getDupCount() >= 0;
EnvironmentImpl envImpl = database.getDbEnvironment();
long dupCountLsn =
dcl.log(envImpl, database.getId(), dupKey, oldDclLsn, locker);