Esempio n. 1
0
 /// <summary>Mark te transaction file as committed</summary>
 /// <param name="isConfirmed"></param>
 private void SetCommited(bool isConfirmed)
 {
     this.isCommited = isConfirmed;
     CheckFileAccess(true);
     try
     {
         // TODO Check atomicity
         // Writes the number of write actions after the byte and date
         fsi.SetWritePositionNoVerification(NeoDatis.Odb.Core.Layers.Layer2.Meta.ODBType.Byte
                                            .GetSize() + NeoDatis.Odb.Core.Layers.Layer2.Meta.ODBType.Long.GetSize(), false);
         fsi.WriteLong(numberOfWriteActions, false, "nb write actions", NeoDatis.Odb.Impl.Core.Transaction.DefaultWriteAction
                       .DirectWriteAction);
         // FIXME The fsi.flush should not be called after the last write?
         fsi.Flush();
         // Only set useBuffer = false when it is a local database to avoid
         // net io overhead
         if (isLocal)
         {
             fsi.UseBuffer(false);
         }
         fsi.SetWritePositionNoVerification(0, false);
         fsi.WriteByte((byte)1, false);
     }
     finally
     {
     }
 }