Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Entity Framework write lock on select

Is there any way to make Entity Framework generate select queries with write lock: SELECT ... FOR UPDATE?

like image 488
SiberianGuy Avatar asked Mar 10 '11 20:03

SiberianGuy


1 Answers

The first result of googling for "entity framework linq select with lock" gave the answer you want. Check this out: http://social.msdn.microsoft.com/forums/en-US/adodotnetentityframework/thread/5219035b-aaa9-4917-b2f2-852b5d8449ea/

Here's an idea though. You can create a stored procedure where you select with lock. Then call that stored procedure via entity framework's generated context.

like image 50
Kon Avatar answered Oct 13 '22 00:10

Kon