Question

What is the default transaction isolation level does InsertOnSubmit call use in LinqToSql?

Was it helpful?

Solution

Use an explicit TranscationScope object constructed with the non-default constructor that takes a TransactionOptions argument. This way you will have the desired isolation level and won't wave to wonder what the default is. Scott Hanselman has an example in Getting LINQ to SQL and LINQ to Entities to use NOLOCK

As a side node the transaction isolation level is largely irrelevant on inserts, as the isolation level refer to the behavior of reads not writes.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top