title: ASP.NET MVC multiple threads access database simultaneously
body: <p>I am building a ASP.NET MVC 4 app using Entity Framework where multiple threads can access a table at the same time (add, delete row, etc.) Right now I am doing <code>using (UserDBContext db = new UserDBContext())</code> within each controller (so a new <code>DBContext</code> is created for each request since MVC framework creates a seperate thread for each request). From what i read, this is safe; however, I am curious about:</p>
  
  <ol>
  <li><p>What happens when two threads access the same table, but not the same row? Are both threads allowed to access simultaneously?</p></li>
  <li><p>What happens when two threads modify the same <em>row</em>? say, one tries to read while the other tries to delete? Is one thread blocked (put to sleep), then gets waken up automatically when the other is done?</p></li>
  </ol>
  
  <p>Thanks!</p>