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

  • Home
  • SEARCH
  • 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 1096937
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T00:21:18+00:00 2026-05-17T00:21:18+00:00

This MSDN article states that: An isolation level has connection-wide scope, and once set

  • 0

This MSDN article states that:

An isolation level has connection-wide
scope, and once set for a connection
with the SET TRANSACTION ISOLATION
LEVEL statement, it remains in effect
until the connection is closed or
another isolation level is set. When a
connection is closed and returned to
the pool, the isolation level from the
last SET TRANSACTION ISOLATION LEVEL
statement is retained. Subsequent
connections reusing a pooled
connection use the isolation level
that was in effect at the time the
connection is pooled.

The SqlConnection class has no member that may hold the isolation level. So how does a connection know what isolation level to run in???

The reason I’m asking this is because of the following scenario:

  1. I opened a transaction using
    TransactionScope in Serializable
    mode, say “T1”.
  2. Opened a connection for T1.
  3. T1 is finished/disposed, connection
    goes back to connection pool.
  4. Called another query on same
    connection (after getting it from
    connection pool) and this query runs
    in serializable mode!!!

Problem:

  1. How does the pooled connection still
    know what isolation level was
    associated to it???
  2. How to revert it back to some other
    transaction level???

Resolution:
The reason why pooled connections are returning the serializable isolation level is because of the following reason:

  1. You have one connection pool (let’s say CP1)
  2. CP1 may have 50 connections.
  3. You pick one connection C1 from CP1 and execute it with Serializable. This connection has its isolation level set now.
    Whatever you do, this will not be reset (unless this connection is
    used to execute a code in a different isolation level).
  4. After executing the query C1(Serializable) goes back to CP1.
  5. If steps 1-4 are executed again then the connection used may be some other connection than C1, let’s say C2 or C3. So, that will also
    have its isolation level set to Serializable.
  6. So, slowly, Serialzable is set to multiple connections in CP1.
  7. When you execute a query where no explicit isolation level setting is being done, the connection picked from CP1 will decide the
    isolation level. For e.g. if such a query requests for a connection
    and CP1 uses C1(Serializable) to execute this query then this query
    will execute in Serializable mode even though you didn’t explicitly
    set it.

Hope that clears a few doubts. 🙂

  • 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-17T00:21:18+00:00Added an answer on May 17, 2026 at 12:21 am

    Isolation levels are implemented in the underlying DBMS, say SqlServer. Setting the isolation level most probably sets up SQL commands which set the isolation level for the connection.

    The DBMS keeps the isolation level as long as the connection stays open. Because the connections is put into the pool, it stays open and keeps the settings made before.

    When messing around with isolation levels, you should either reset the isolation level at the end of any transaction, or, even better, set it when a new connection is requested.

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

Sidebar

Related Questions

This MSDN article stated that: processors are free to reorder this code internal static
I've found this MSDN article that explains how to monitor processes and services with
According this MSDN article HttpApplication .EndRequest can be used to close or dispose of
I'm building a Windows service and following this MSDN article , but I'm stuck
I have been playing with the demo code from this msdn article by Jeffrey
Some 4 years back, I followed this MSDN article for DateTime usage best practices
Taking this article on classes and structs as an example: http://msdn.microsoft.com/en-us/library/ms173109.aspx namespace ProgrammingGuide {
In this MSDN article (Chapter 6 — Improving ASP.NET Performance), it says the following:
I'm trying to implement the Media Player custom field control described in this MSDN
I have seen this syntax in MSDN: yield break , but I don't know

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.