public virtual void LoadWriteActions(string filename, bool apply) { if (NeoDatis.Odb.OdbConfiguration.IsDebugEnabled(LogId)) { NeoDatis.Tool.DLogger.Debug("Load write actions of " + filename); } NeoDatis.Odb.Impl.Core.Transaction.DefaultWriteAction wa = null; try { CheckFileAccess(false, filename); fsi.UseBuffer(true); fsi.SetReadPosition(0); isCommited = fsi.ReadByte() == 1; creationDateTime = fsi.ReadLong(); long totalNumberOfWriteActions = fsi.ReadLong(); if (NeoDatis.Odb.OdbConfiguration.IsDebugEnabled(LogId)) { NeoDatis.Tool.DLogger.Info(writeActions.Count + " write actions in file"); } for (int i = 0; i < totalNumberOfWriteActions; i++) { wa = NeoDatis.Odb.Impl.Core.Transaction.DefaultWriteAction.Read(fsi, i + 1); if (apply) { wa.ApplyTo(fsiToApplyWriteActions, i + 1); wa.Clear(); } else { AddWriteAction(wa, false); } } if (apply) { fsiToApplyWriteActions.Flush(); } } finally { } }
public static NeoDatis.Odb.Impl.Core.Transaction.DefaultWriteAction Read(NeoDatis.Odb.Core.Layers.Layer3.Engine.IFileSystemInterface fsi, int index) { try { long position = fsi.ReadLong(); int size = fsi.ReadInt(); byte[] bytes = fsi.ReadBytes(size); NeoDatis.Odb.Impl.Core.Transaction.DefaultWriteAction writeAction = new NeoDatis.Odb.Impl.Core.Transaction.DefaultWriteAction (position, bytes); if (NeoDatis.Odb.OdbConfiguration.IsDebugEnabled(LogId)) { NeoDatis.Tool.DLogger.Debug("Loading Write Action # " + index + " at " + fsi.GetPosition () + " => " + writeAction.ToString()); } return(writeAction); } catch (NeoDatis.Odb.ODBRuntimeException e) { NeoDatis.Tool.DLogger.Error("error reading write action " + index + " at position " + fsi.GetPosition()); throw; } }