0
我已經滿足了問題,代碼樣子簡單,但例外:NHibernate的查詢異常,任何機構幫助我?
DDS.Model.ATest atest = new DDS.Model.ATest();
atest.AID = Guid.NewGuid();
ISession session = SessionProvider.GetNewSession();
using (ITransaction transaction = session.BeginTransaction())
{
session.SaveOrUpdate(atest);
int count = session.CreateQuery("from ATest").List().Count;
//Above row throw a exception:
//Batch update returned unexpected row count from update; actual row count: 0; expected: 1
transaction.Commit();
}
但我的程序邏輯必須在事務提交之前進行查詢,其他方法可以做什麼? – user1516381
嘗試刪除AID分配線。這首先是造成問題的原因。 –
ATest.nhb.xml文件如下所示匹配ID列: \t \t \t \t \t –
user1516381