/// <summary> /// Switches page manager instance to normal mode. /// All the changes made since the last EnterAtomicOperation() call are applied. /// </summary> public void ExitAtomicOperation() { if (_deferredUpdatesMode) { // write end marker to indicate that // one can playback the recovery records // without risking to corrupt the storage _recoveryFile.WriteFinalMarker(); // switch off deferred update mode for normal page management operation _deferredUpdatesMode = false; foreach (var pageIndex in _recoveryFile.UpdatedPageIndexes) { UpdatePage(new Page(this, pageIndex, _recoveryFile.GetUpdatedPageContent(pageIndex))); } foreach (var index in _recoveryFile.DeletedPageIndexes) { RemovePage(index); } Flush(_storageStream); _pagemap.Flush(); // now all are done, reset the recovery file _recoveryFile.Reset(); } }