Entity Framework Code First: SaveChanges is not atomic

后端 未结 1 1485
刺人心
刺人心 2021-02-04 13:49

I have the following very simple unit test that reproduces a case where DbContext.SaveChanges is not atomic. By not atomic I mean that the committed data can be read before all

1条回答
  •  北荒
    北荒 (楼主)
    2021-02-04 14:50

    Try the database option "Is Read Commited Snapshot On"=True.

    We had same kind of issues. This option solved them.

    More information on:

    http://msdn.microsoft.com/en-us/library/ms173763.aspx

    and

    Add object and its relationships atomically in SQL Server database

    0 讨论(0)
提交回复
热议问题