コード例 #1
0
        private void ApplyTo()
        {
            int realWriteNumber = 0;
            int noPointerWA     = 0;

            if (!isCommited)
            {
                NeoDatis.Tool.DLogger.Info("can not execute a transaction that is not confirmed");
                return;
            }
            if (hasAllWriteActionsInMemory)
            {
                for (int i = 0; i < writeActions.Count; i++)
                {
                    NeoDatis.Odb.Impl.Core.Transaction.DefaultWriteAction wa = (NeoDatis.Odb.Impl.Core.Transaction.DefaultWriteAction
                                                                                )writeActions[i];
                    wa.ApplyTo(fsiToApplyWriteActions, i + 1);
                    wa.Clear();
                }
                fsiToApplyWriteActions.Flush();
            }
            else
            {
                LoadWriteActions(true);
                fsiToApplyWriteActions.Flush();
            }
        }
コード例 #2
0
 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
     {
     }
 }