Thanks in advance, guys!
TransactionScope will pass the isolation level to SQL Server only as a suggestion. It depends on each database server implementation on what will happen in these type of situations (ignore the isolation level, try to follow it only when possible or return error when mismatched). Also see http://blogs.msdn.com/florinlazar/archive/2003/12/10/42686.aspx
Cheers!
Florin Lazar - MSFT wrote:
TransactionScope will pass the isolation level to SQL Server only as a suggestion. It depends on each database server implementation on what will happen in these type of situations (ignore the isolation level, try to follow it only when possible or return error when mismatched). Also see http://blogs.msdn.com/florinlazar/archive/2003/12/10/42686.aspx
Cheers!
Mixing isolation levels is not a good practice.
Imagine the ambient transaction having the isolation level set to Serializable and imagine that a new piece of code (for instance in a new library added to the project) is called under this transaction. If that new piece of code is using TransactionScope with isolation level set to ReadUncommitted, then that meant that it expects a certain level of performance and a certain level of locking. If we would allow the Serializable transaction to get in, those expectations might not be met and this behavior can lead to performance degradation and more than that, possible deadlocks. I hope this helps.
There are problems with both cases: going to higher or going to a lower isolation level.
As for the XACT_ABORT default, please follow up with the SQL Server team on that. They have a forum at http://forums.microsoft.com/MSDN/ShowForum.aspx ForumID=85&SiteID=1.
Cheers!