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 4108000
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T21:35:31+00:00 2026-05-20T21:35:31+00:00

How do I configure transactions in Entity Framework 4? In plain old Ado.Net we

  • 0

How do I configure transactions in Entity Framework 4? In plain old Ado.Net we had a class named SqlTransaction, we could also specify isolation level for that transaction like Read_Committed, Read_UnCommitted etc. I can’t find all these options in Entity Framework. How can we configure them?

  • 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-20T21:35:31+00:00Added an answer on May 20, 2026 at 9:35 pm

    You can use the TransactionScope class, and set the isolation level using TransactionOptions as described here:

    Some of the overloaded constructors of TransactionScope accept a structure of type TransactionOptions to specify an isolation level, in addition to a timeout value. By default, the transaction executes with isolation level set to Serializable. Selecting an isolation level other than Serializable is commonly used for read-intensive systems. This requires a solid understanding of transaction processing theory and the semantics of the transaction itself, the concurrency issues involved, and the consequences for system consistency.

    For example:

    using (var context = new EFTestEntities())
    {
        context.AddToProducts(new Product { Name = "Widget" });
        context.AddToProducts(new Product { Name = "Chotchky" });
    
        TransactionOptions options = new TransactionOptions { IsolationLevel = System.Transactions.IsolationLevel.ReadCommitted, Timeout = TransactionManager.DefaultTimeout };
    
        using (var scope = new TransactionScope(TransactionScopeOption.RequiresNew, options))
        {
            // do any EF work that you want to be performed in the transaction
            context.SaveChanges();
    
            // commit the transaction
            scope.Complete(); 
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I learnt how can we configure transactions in Entity Framework using TransactionScope in one
I am using spring/hibernate stand alone application. if i dont configure Transactions i am
Tried to configure Spring for tests with hibernate and transactions. Getting bean from app
We have some code that uses Entity Framework against a DB2 database. When we
I am trying to configure JTA Transactions with Atomkios in Tomcat 5.5 for jndi
We are using Transaction Scope for performing transactions in .Net 3.0. How do I
At university, we were given task to use ADO.NET or LINQ to SQL and
They recommend using JTA transaction support in Java EE environment. But how to configure
I configure eclipse Helios Service Release 2 , eclipse properly download and configure ADT
I configure Drupal to log in with CAS. After login in CAS, When I

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.