*/
private LogItem logCommitEntry(SyncPolicy flushSyncBehavior,
Collection<WriteLockInfo> obsoleteLsns)
throws DatabaseException {
LogManager logManager = envImpl.getLogManager();
assert checkForValidReplicatorNodeId();
SingleItemEntry commitEntry =
new SingleItemEntry(LogEntryType.LOG_TXN_COMMIT,
new TxnCommit(id,
lastLoggedLsn,
getReplicatorNodeId()));
LogItem item = new LogItem();
item.entry = commitEntry;
item.provisional = Provisional.NO;
item.repContext = repContext;
LogContext context = new LogContext();
context.obsoleteWriteLockInfo = obsoleteLsns;
switch (flushSyncBehavior) {
case SYNC:
context.flushRequired = true;
context.fsyncRequired = true;
break;
case WRITE_NO_SYNC:
context.flushRequired = true;
context.fsyncRequired = false;
break;
default:
context.flushRequired = false;
context.fsyncRequired = false;
break;
}
logManager.log(item, context);
return item;
}