Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1056367
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T17:42:20+00:00 2026-05-16T17:42:20+00:00

The current implementation of TransactionScope lacks the ability to change IsolationLevels in nested scopes.

  • 0

The current implementation of TransactionScope lacks the ability to change IsolationLevels in nested scopes.

MSDN states: When using nested TransactionScope objects, all nested scopes must be configured to use exactly the same isolation level if they want to join the ambient transaction. If a nested TransactionScope object tries to join the ambient transaction yet it specifies a different isolation level, an ArgumentException is thrown.

However SQL Server allows us to change Isolation Levels at any times we please, why doesn’t the TransactionScope allow? I don’t get it.

Are there any standards in the BCL about nested SQL Transactions and their isolation levels that prohibits this behavior. What are my options? I certainly cannot design class libraries and promote Isolation Levels along with them just for the sake that they can be used.

If method A() wants a Snapshot level and calls method B() which wants Read Committed level. Method A() is in LibraryA which is developed by me, method B() is in LibraryB which is developed by a fictitious company. How can A() call B() without getting ArgumentException?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T17:42:21+00:00Added an answer on May 16, 2026 at 5:42 pm

    This is more a question of theory than of any particular product. Basically, the original notion of a transaction is something that has all the ACID properties: Atomic, Consistent, Isolated, and Durable.

    http://databases.about.com/od/specificproducts/a/acid.htm

    Now, consider what is meant by “isolation level”: essentially, for performance or other reasons, we may choose to forego some or all of the guarantees that the database makes concerning ACIDity. Isolation and atomicity are intimately related, like a dual of each other. Break one, and the other suffers.

    It’s common to break a transaction into the parts that are individually expressible in particular SQL statements, but for your guarantees to help at all, you need to wrap them up in a transaction with at least enough isolation for the whole shmear to work properly.

    Now, if some fraction of your transaction requires a greater degree of isolation, then the whole transaction does also, or else it could break during the sensitive part. Conversely, if some part is given a lower level of isolation, then it could well be that the proper function of that part requires less isolation. (Don’t ask me to come up with a good example of when this could be true.)

    Anyway, the database server has no way of telling if the actual requirements are compatible, so it gives up on the problem altogether.

    What’s really supposed to happen is that people develop the transactions they need. I realize this isn’t always easy, but in light of the fact that your business data schema is yours alone, it’s not supposed to be easy to plug random SQL components together.

    In the case of dealing with centralized databases (like SQL Server) the best practice is to design entire transactions, and then as you notice commonality among the designs, you can factor it out possibly before you write hairy code.

    If you really need to coordinate among different data repositories (or similar) then a distributed transaction manager is called for. It’s a separate product, and even more difficult to get right than a database server. But that’s necessary for things like ATMs which either give you money or don’t, and which either hit your bank account or don’t, and those two have to match.

    Good luck!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Due to my current implementation of using QR Codes, I cannot change the request
My current implementation of an Hash Table is using Linear Probing and now I
I'm using Autofac and want to resolve the correct implementation of the current assembly
In my current implementation of a UISearchBarController I'm using [NSString compare:] inside the filterContentForSearchText:scope:
In our current implementation we are forewarding all relevant emails to a mail alias
I want to replace the bitshift bool overload for i/ostream. The current implementation only
Paramiko's SFTPClient apparently does not have an exists method. This is my current implementation:
I read that with .NET Framework 4 the current garbage collection implementation is replaced:
There is a custom implementation of KSPA which needs to be re-written. The current
I have been reviewing the setup of a current Amazon Web Store implementation to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.