views:

26

answers:

1

I would like to allow two threads to write in a table at the same time (I know the problem of updating the same row, but this would be a story apart). I need that in behalf of speed up the operations in my aplication (one thread could write in row X while another could do the same in row X+n instead of waiting the first to finalize).

So, can I block rows instead of tables with Linq to SQL?

Thanks.

A: 

LINQ to SQL does not block any tables. It simply sends SQL queries to your SQL Server database and it is up to SQL Server to deside how to block. However, when your database has the proper design (right indexes etc) SQL server will not lock your whole table when you've queried a single row and update that row. Therefore, you can expect that scenario to just work.

Steven