Nhibernate Flush causing Updates where there should be none

前端 未结 2 1486
萌比男神i
萌比男神i 2021-01-25 00:31

I am using the Repo pattern, and I have set up tests to replicate my a HTTP request coming in and then causing dispose on a unit of work once a test has completed.

It ap

2条回答
  •  生来不讨喜
    2021-01-25 01:00

    NHibernate typically runs updates when it has transient or detached entities that it isn't sure about. That is, entities that it doesn't know if it has a parent for that manages it or if its not sure the entity is dirty. This is typically a symptom of a bad mapping somewhere (a missing Inverse on some parent) or you have no Version or Date column on your entities.

提交回复
热议问题