我将 db4o 用于一个带有嵌入式数据库的简单应用程序。当我保存一个对象,然后更改对象时,是否假设 db4o 返回更改后的对象?
这是代码:
[Test]
public void NonReferenceTest()
{
Aim localAim = new Aim("local description", null);
dao.Save(localAim);
// changing the local value should not alter what we put into the dao
localAim.Description = "changed the description";
IQueryable<Aim> aims = dao.FindAll();
var localAim2 = new Aim("local description", null);
Assert.AreEqual(localAim2, aims.First());
}
测试失败。我需要以任何特殊方式设置 db4o 容器吗?将其包装在提交调用中?谢谢