private void NewSystemData(byte freespaceSystemType, byte idSystemType)
 {
     _systemData = new Db4objects.Db4o.Internal.SystemData();
     _systemData.StringEncoding(ConfigImpl.Encoding());
     _systemData.FreespaceSystem(freespaceSystemType);
     _systemData.IdSystemType(idSystemType);
 }
        /// <exception cref="Db4objects.Db4o.Ext.OldFormatException"></exception>
        internal virtual void ReadThis()
        {
            NewSystemData(AbstractFreespaceManager.FmLegacyRam, StandardIdSystemFactory.Legacy
                          );
            BlockSizeReadFromFile(1);
            _fileHeader = FileHeader.Read(this);
            if (Config().GenerateCommitTimestamps().IsUnspecified())
            {
                Config().GenerateCommitTimestamps(_systemData.IdToTimestampIndexId() != 0);
            }
            CreateStringIO(_systemData.StringEncoding());
            CreateIdSystem();
            InitializeClassMetadataRepository();
            InitalizeWeakReferenceSupport();
            SetNextTimeStampId(SystemData().LastTimeStampID());
            ClassCollection().SetID(_systemData.ClassCollectionID());
            ClassCollection().Read(SystemTransaction());
            Converter.Convert(new ConversionStage.ClassCollectionAvailableStage(this));
            _fileHeader.ReadIdentity(this);
            if (_config.IsReadOnly())
            {
                return;
            }
            if (!ConfigImpl.CommitRecoveryDisabled())
            {
                _fileHeader.CompleteInterruptedTransaction(this);
            }
            IFreespaceManager blockedFreespaceManager = AbstractFreespaceManager.CreateNew(this
                                                                                           , _systemData.FreespaceSystem());

            InstallFreespaceManager(blockedFreespaceManager);
            blockedFreespaceManager.Read(this, _systemData.InMemoryFreespaceSlot());
            blockedFreespaceManager.Start(_systemData.BTreeFreespaceId());
            _fileHeader = _fileHeader.Convert(this);
            if (FreespaceMigrationRequired(blockedFreespaceManager))
            {
                MigrateFreespace(blockedFreespaceManager);
            }
            WriteHeader(true, false);
            if (Converter.Convert(new ConversionStage.SystemUpStage(this)))
            {
                _systemData.ConverterVersion(Converter.Version);
                _fileHeader.WriteVariablePart(this);
                Transaction.Commit();
            }
        }
Exemplo n.º 3
0
		private void NewSystemData(byte freespaceSystemType, byte idSystemType)
		{
			_systemData = new Db4objects.Db4o.Internal.SystemData();
			_systemData.StringEncoding(ConfigImpl.Encoding());
			_systemData.FreespaceSystem(freespaceSystemType);
			_systemData.IdSystemType(idSystemType);
		}