【发布时间】:2014-03-25 13:34:40
【问题描述】:
对不起,如果我的问题没有太多细节,但我是 nhibernate 的新手,所以不知道如何表达。我想知道为什么在 Web 应用程序中调用会话刷新不会引发错误,但 Commit 会。
我正常有这个代码:
session.SaveOrUpdate(item);
session.Flush();
但是如果我调用 session.Commit() 我会得到 a different object with the same identifier value was already associated with the session 错误
Commit 和 Flush 的工作方式不同吗?
【问题讨论】:
标签: nhibernate