views:

157

answers:

2

When I am using a TransactionScope object I can specify the Isoaltion Level using the transaction options.

What is the default isolation level used if none is specified?

Is it possible to set an application wide default isolation level that would be used by the TransactionScopes?

+1  A: 

You could create your own object to wrap the TransactionScope, setting the correct Isolation level, then use that in place of a TransactionScope.

I can't guarantee this would work, but sounds plausible. Let me know if it does and I'll update the answer.

ck
+1  A: 

We just have a helper method TransactionManager.CreateTransactionScope which creates one with the project-wide options. It's also a useful place to encapsulate additional logic such as if there is an ambient transaction you can either use that, or create a nested transaction with compatible options, or create a new transaction, depending on what suits your application (you may want to create overloads specifying which of these behaviours are allowed).

Greg Beech