Fluent NHibernate Newbie: Row was updated or deleted by another transaction

旧巷老猫 提交于 2019-12-06 15:49:47

Solved with Mapping

NHibernate was assigning User IDs (Guid) for me using the Guid comb method. Manually specifying the ID was tripping up the mapping. I prefer to assign these IDs myself, so I changed the User entity ID mapping to be manually assigned in my UserMap class:

Id(x => x.Id).GeneratedBy.Assigned();

This error also occurs when the changed context and you if you PK is character.

The Solution is apply Trim() in PK when Update(data, data.code.Trim());

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!