deerchao的blog

Be and aware of who you are.

导航

统计

公告

a different object with the same identifier value was already associated with the session (MonoRail + ActiveRecord)

遇到这个问题的代码很可能像这样:


[Layout("default")]
public void Save([ARDataBind("item")]Item item)
{
        item.Save();
}

解决它的办法也很简单,改成下面这样就可以了:

[Layout("default")]
public void Save([ARDataBind("item", AutoLoadBehavior.NewInstanceIfInvalidKey)]Item item)
{
        item.Save();
}

posted on 2007-09-18 12:18 deerchao 阅读(1062) 评论(1)  编辑 收藏