/// <exception cref="System.Exception"></exception>
		public override void SetUp()
		{
			File4.Delete(TempFile());
			IoAdapter adapter = new RandomAccessFileAdapter();
			adapter = adapter.Open(TempFile(), false, 0, false);
			adapter.Write(new byte[] { 1, 2, 3 }, 3);
			adapter.Close();
		}
Esempio n. 2
0
		private void PrepareDbFile(int itemCount)
		{
			Sysout("Preparing DB file ...");
			DeleteFile(_dbFileName);
			Db4objects.Db4o.IO.IoAdapter rafFactory = new RandomAccessFileAdapter();
			Db4objects.Db4o.IO.IoAdapter raf = rafFactory.Open(_dbFileName, false, 0, false);
			LogReplayer replayer = new LogReplayer(CrudApplication.LogFileName(itemCount), raf
				);
			try
			{
				replayer.ReplayLog();
			}
			catch (IOException)
			{
				ExitWithError("Error reading I/O operations log file");
			}
			finally
			{
				raf.Close();
			}
		}
Esempio n. 3
0
		/// <exception cref="NumberFormatException"></exception>
		/// <exception cref="IOException"></exception>
		/// <exception cref="Db4oIOException"></exception>
		private Db4objects.Db4o.IO.IoAdapter IoAdapter(string dbFileName)
		{
			if (Delayed())
			{
				return DelayingIoAdapter(dbFileName);
			}
			Db4objects.Db4o.IO.IoAdapter rafFactory = new RandomAccessFileAdapter();
			return rafFactory.Open(dbFileName, false, 0, false);
		}