Home >

Concurrency and Locking in Entity Framework

29. December 2011

So I was talking to a friend this afternoon and the question of how Entity Framework handles locking came up. It is important to know that no pessimistic locking exists in Entity framework. Save Changes uses implementation of DbTransaction for current store provider. It means that default transaction isolation level is set to default value for the database server. In SQL Server it is Read Committed.

Make sure you look at how the tables are defined when it comes to lock levels and how the server you are using is configured.

 

Here are the details that I pointed him to.

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

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

 

Enjoy.