sandipandeb wrote:
Hi ,
Can anyone provide me more information on when the following Nhibernate Exception occurs.
SQL insert, update or delete failed (expected affected row count: 1, actual affected row count: 0). Possible causes: the row was modified or deleted by another user, or a trigger is reporting misleading row count.
One example: if update query looks like
UPDATE YourTable
SET [..]
WHERE Id = 1
But there is no row with Id = 1 in database. According to posts in the forum, it may happen when NHibernate is unable to correctly determine whether an object must be inserted or updated in database. (NHIbernate thinks that he must update an object but in realuity the object needs to be inserted).