01
private static void StorePilots()
02
...{
03
File.Delete(Db4oFileName);
04
IObjectContainer container = Database();
05
if (container != null)
06
...{
07
try
08
...{
09
Pilot pilot;
10
for (int i = 0; i < ObjectCount; i++)
11
...{
12
pilot = new Pilot("Test Pilot #" + i, i);
13
container.Set(pilot);
14
}
15
for (int i = 0; i < ObjectCount; i++)
16
...{
17
pilot = new Pilot("Professional Pilot #" + (i + 10), i + 10);
18
container.Set(pilot);
19
}
20
container.Commit();
21
}
22
catch (Db4oException ex)
23
...{
24
System.Console.WriteLine("Db4o Exception: " + ex.Message);
25
}
26
catch (Exception ex)
27
...{
28
System.Console.WriteLine("System Exception: " + ex.Message);
29
}
30
finally
31
...{
32
CloseDatabase();
33
}
34
}
35
}