i have a problem with db4o and I wanna know is it feature or bug.
Let's see some code
private interface IInterface {}
private class SimpleObject : IInterface
{}
[TestMethod, Ignore]
public void _()
{
var replicableServer = Db4oFactory.OpenServer(Path.GetFullPath(@"testdb"), 777);
try
{
replicableServer.GrantAccess("user", "user");
var client2 = Db4oFactory.OpenClient("127.0.0.1", 777, "user", "user");
var client1 = Db4oFactory.OpenClient("127.0.0.1", 777, "user", "user");
client1.Store(new SimpleObject());
client1.Commit();
var query = client2.Query();
query.Constrain(typeof(IInterface));
Assert.AreEqual(1, query.Execute().Count);
}
finally
{
replicableServer.Close();
}
}
Here we have failed assert. But if we change type in constraint to SimpleObject, all would work fine. This is strange and I can't find reason to this.
Thank guys. But we solved this riddle. Problem was, that db4o saving information about object and what interface it implement, only after first save.
So, we simple saved all our empty objects to base, before work with it.