/// <exception cref="Db4objects.Db4o.Ext.OldFormatException"></exception>
		/// <exception cref="Db4objects.Db4o.Ext.DatabaseReadOnlyException"></exception>
		protected sealed override void OpenImpl()
		{
			Config4Impl configImpl = ConfigImpl;
			IStorage storage = configImpl.Storage;
			bool isNew = !storage.Exists(FileName());
			if (isNew)
			{
				LogMsg(14, FileName());
				CheckReadOnly();
				_handlers.OldEncryptionOff();
			}
			bool readOnly = configImpl.IsReadOnly();
			bool lockFile = Debug4.lockFile && configImpl.LockFile() && (!readOnly);
			if (NeedsLockFileThread())
			{
				IBin fileBin = storage.Open(new BinConfiguration(FileName(), false, 0, false, configImpl
					.BlockSize()));
				IBin synchronizedBin = new SynchronizedBin(fileBin);
				_file = new BlockAwareBin(synchronizedBin);
			}
			else
			{
				IBin bin = storage.Open(new BinConfiguration(FileName(), lockFile, 0, readOnly, configImpl
					.BlockSize()));
				if (configImpl.AsynchronousSync())
				{
					bin = new ThreadedSyncBin(bin);
				}
				_file = new BlockAwareBin(bin);
			}
			if (isNew)
			{
				ConfigureNewFile();
				if (configImpl.ReservedStorageSpace() > 0)
				{
					Reserve(configImpl.ReservedStorageSpace());
				}
				CommitTransaction();
				WriteHeader(true, false);
			}
			else
			{
				ReadThis();
			}
		}
示例#2
0
 public _IClosure4_85(ThreadedSyncBin _enclosing, IRunnable runnable)
 {
     this._enclosing = _enclosing;
     this.runnable   = runnable;
 }
示例#3
0
 public _IClosure4_46(ThreadedSyncBin _enclosing)
 {
     this._enclosing = _enclosing;
 }
示例#4
0
 public _IRunnable_23(ThreadedSyncBin _enclosing)
 {
     this._enclosing = _enclosing;
 }
			public _IClosure4_46(ThreadedSyncBin _enclosing)
			{
				this._enclosing = _enclosing;
			}
			public _IRunnable_23(ThreadedSyncBin _enclosing)
			{
				this._enclosing = _enclosing;
			}
			public _IClosure4_85(ThreadedSyncBin _enclosing, IRunnable runnable)
			{
				this._enclosing = _enclosing;
				this.runnable = runnable;
			}