NHibernate.StaleStateException:批量更新从更新返回意外的行数;实际行数:9;预期:10

时间:2017-12-18 17:09:18

标签: c# sql-server nhibernate

   {NHibernate.TransactionException: An error occured when trying to dispose the transaction ---> NHibernate.StaleStateException: Batch update returned unexpected row count from update; actual row count: 9; expected: 10
       at NHibernate.AdoNet.Expectations.VerifyOutcomeBatched(Int32 expectedRowCount, Int32 rowCount)
       at NHibernate.AdoNet.SqlClientBatchingBatcher.DoExecuteBatch(IDbCommand ps)
       at NHibernate.AdoNet.AbstractBatcher.ExecuteBatchWithTiming(IDbCommand ps)
       at NHibernate.AdoNet.AbstractBatcher.ExecuteBatch()
       at NHibernate.AdoNet.AbstractBatcher.OnPreparedCommand()
    }

每次删除实体时都会收到此错误。     使用Nhibernate,但这个错误似乎只适用于SQLServer2014(没有尝试过SQLServer2008),但对Postgres工作正常。     对象很简单,有一个" X"引用" Y"的集合的对象实体。     错误是从X中删除集合Y中的enitity。

任何建议。

0 个答案:

没有答案