zzz projects Entity Framework 6 EF 6
Home EF Core 5 Articles Knowledge Base Online Examples
  • Home
  • EF Core 5
  • Articles
  • Knowledge Base
  • Online Examples

Entity Framework 6 - Knowledge Base (KB)

English (en) Français (fr) Español (es) Italiano (it) Deutsch (de) русский (ru) 한국어 (ko) 日本語 (ja) 中文简体 (zh-CN) 中文繁體 (zh-TW)

45 results for: in tag: transactions

Entity Framework: Using transactions and rollbacks... Possible?

Issue: (With Sql 2005)...How can I query the database while the transaction is up? (Since it locks the table)...How can cause a transaction to rollback and then close itself to allow the table to be queried?...So I found this much:...[TestMethod] public v...
entity-framework transactions
asked by Programmin Tool

Why doesn't TransactionScope work with Entity Framework?

See the code below. If I initialize more than one entity context, then I get the following exception on the ...2nd set of code only.... If I comment out the second set it works....{"The underlying provider failed on Open."}...Inner: {"Communication with...
.net c# entity-framework transactions transactionscope
asked by NotDan

Using Transactions or SaveChanges(false) and AcceptAllChanges()?

I have been investigating transactions and it appears that they take care of themselves in EF as long as I pass ...false... to ...SaveChanges()... and then call ...AcceptAllChanges()... if there are no errors:...SaveChanges(false); // ... AcceptAllChanges...
c# entity-framework transactions
asked by mark smith

How to use transactions with the Entity Framework?

When you have code like this:...Something something = new Something(); BlahEntities b = new BlahEntities() b.AddToSomethingSet(something); b.SaveChanges(); ...how do run that addition inside a transaction?
entity-framework transactions
asked by pupeno

How to rollback a transaction in Entity Framework

string[] usersToAdd = new string[] { "asd", "asdert", "gasdff6" }; using (Entities context = new Entities()) { foreach (string user in usersToAdd) { context.AddToUsers(new User { Name = user }); } try { context.SaveChan...
c# entity-framework rollback savechanges transactions
asked by Shimmy

SqlException from Entity Framework - New transaction is not allowed because there are other threads running in the session

I am currently getting this error:...System.Data.SqlClient.SqlException: New transaction is not allowed because there are other threads running in the session....while running this code:...public class ProductManager : IProductManager { #region Declar...
c# entity-framework inversion-of-control transactions
asked by Keith Barrows

How to run two Entity Framework Contexts inside TransactionScope without MSDTC?

This problem is not readily reproducible in a simple example here but was wondering if anyone has any experience and tips, here is the issue:...using ...Entity Framework...have many points in application where (1) data is written to some ...entity... tabl...
entity-framework msdtc transactions
asked by Edward Tanguay

How to force Entity Framework not to lock the database

Possible Duplicate:...Entity Framework with NOLOCK...I'm using EF4 and .Net 4 to load some XML from a file into a database....I have a class the wraps around the ObjectContext and has methods that add the marshalled objects from the XML file to the variou...
entity-framework transactions
asked by James

What is the default transaction isolation level in Entity Framework when I issue “SaveChanges()”?

What is the default transaction isolation level in Entity Framework when I issue “SaveChanges()”? I can not find it anywhere. Shall it be "Serializable"?
.net ado.net entity-framework transactions
asked by BigMountainTiger

Bulk inserts with EntityFramework 4.0 causes abort of transaction

We are receiving a file from a client (Silverlight) via WCF and on the serverside I parse this file. Each line in the file is transformed into an object and stored into the database. if the file is very large (10000 entries and more), I get the following ...
entity-framework transactions
asked by HarryK

Preventing race condition of if-exists-update-else-insert in Entity Framework

I've been reading other questions on how to implement if-exists-insert-else-update semantics in EF, but either I'm not understanding how the answers work, or they are in fact not addressing the issue. A common solution offered is to wrap the work in a tr...
.net entity-framework race-condition transactions
asked by Mike Chamberlain

EF Competing SaveChanges() Calls

I am building a batch processing system. Batches of ...Units... come in quantities from 20-1000. Each ...Unit... is essentially a hierarchy of models (one main model and many child models). My task involves saving each model hierarchy to a database as ...
.net c# entity-framework sqlbulkcopy transactions
asked by Jeff Swensen

System.Data.EntityException: The underlying provider failed on Commit

Using Entity Framework, I received a number of the following exceptions last night in one of my applications:...System.Data.EntityException: The underlying provider failed on Commit. ---> System.Data.SqlClient.SqlException: Timeout expired. The timeout ...
.net entity-framework sqlclient sql-server transactions
asked by Randy

Unit Of Work Pattern with Database Transactions

I've been tried to get my head around this for a couple of days and there are lots of tutorials around unit of work and around TransactionScope but I can't find anything that talks about the two together. Any help much appreciated!...I am using Entity Fra...
c# entity-framework transactions transactionscope
asked by Matt Austin

Transaction scope timeout on 10 minutes

I have a long running ...TransactionScope... in C#. I told the scope that it should have a long timespan, but still I get a timeout. What could cause this?...TransactionOptions transactionOptions = new TransactionOptions(); transactionOptions.IsolationLev...
c# entity-framework transactions transactionscope
asked by Patrick

Entity Framework and transaction isolation level

I'm using Entity Framework 4.0. Now I need to restrict access to a table while I'm reading from it or writing to it. Probably that's about transaction isolation level....How do I do that?...Update...here is what I have...using (var db = new MyDb()) { ...
.net c# entity-framework transactions
asked by Alan Coromano

Custom atomic UPDATE commands inside SaveChanges()

For various reasons I need to be able to do several custom SQL ...UPDATE... commands when I call ...SaveChanges... on a ...DbContext.... I want this to happen atomically so either both the regular ...SaveChanges... and the SQL succeeds, or neither does...
c# dapper entity-framework savechanges transactions
asked by JulianR

Transactions commit and rollback with Entity Framework, Mysql and LINQ to SQL in C#

My problem is that the ...transaction... is not working properly it should not save the data for one table if an exception occurs during the ...trascation...When all the table is correct then only save data....Consider the following:...databaseEntites obj...
c# entity-framework linq-to-sql mysql transactions
asked by user1045389

Entity Framework - "New transaction is not allowed because there are other threads running in the session"

I am getting the following error trying to save changes in entity framework -...System.Data.SqlClient.SqlException: New transaction is not allowed because there are other threads running in the session....I have seen various answers to this problem, but I...
asp.net entity-framework transactions
asked by user1948635

How do you configure the Transaction time out in Entity Framework 6 DbContext.Database.BeginTransaction?

Using code like...using (var tran = Ctxt.Database.BeginTransaction()) { ...How can I set a value for the transaction timeout ?
entity-framework transactions
asked by John Waters

Page 1 of 3
  • 1
  • 2
  • 3
  • »

Prime Library

Performance

  • Entity Framework Extensions
  • Entity Framework Classic
  • Bulk Operations
  • Dapper Plus

Expression Evaluator

  • C# Eval Expression
  • SQL Eval Function
More Projects...

Related

  • EF Extensions Online Benchmark
  • WIN an EF Extensions license
  • EF6 BatchSaveChanges for only $79
Save your entities 20× faster with EF Extensions
SaveChanges vs BulkSaveChanges

Try for free now