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)

20 results for: in tag: multithreading

Concurrent access to a database with Entity Framework == EntityException

I've a MS SQL 2008 database which is accessed through LINQ for data update/retrival....My linq is accessed by WCF services in a PerCall instantiation mode for an heavy application. This application has several thread which makes calls to the service, and ...
concurrency entity-framework multithreading sql wcf
asked by J4N

c# working with Entity Framework in a multi threaded server

What is the best practice for working with entity framework in a multi threaded server? I'm using entity framework ...ObjectContext... to manage all my database actions, now I know this context isn't thread safe, so for now when I need to use it to perfor...
c# database entity-framework multithreading objectcontext
asked by Eyal

Multithreading Entity Framework: The connection was not closed. The connection's current state is connecting

So I have a windows service process that performs a workflow process. The back end uses Repository and UnitofWork Pattern and Unity on top of Entity Framework with the entities class generated from the edmx. I won't go into a whole lot of detail as its no...
dbcontext entity-framework multithreading
asked by Brandon

Parallel doesnt work with Entity Framework

I have a list of IDs, and I need to run several stored procedures on each ID....When I am using a standard foreach loop, it works OK, but when I have many records, it works pretty slow....I wanted to convert the code to work with EF, but I am getting an e...
.net c# entity-framework multithreading parallel-processing
asked by m0fo

Entity Framework Pass Object from One Context to Another

I am new to Entity Framework so please bear with me. ...I have a program that I want to select multiple records from a table and store it in a queue:...private Queue<RecordsToProcess> getRecordsToProcess() { Queue<RecordsToProcess> results = new Queu...
c# entity-framework multithreading
asked by jkruer01

This operation is not supported in wcf test client because it uses system.threading.tasks.task

I'm trying to create an asynchronous method in my WCF service, but am getting the above subject error message. I simply want to return a list of Categories....To be clear, tack on the following to the above error message at the end: YeagerTechModel.Catego...
.net c# entity-framework multithreading wcf
asked by sagesky36

Thread safe Entity Framework 6

Just starting testing EF6 and its Async functions. Boy was I surprised when I realized that they are not thread safe. I kinda assumed that that was the point....I had my own ...Task... based extension methods for years already, but what I was waiting for ...
entity-framework entity-framework-6 multithreading task-parallel-library
asked by Rabbi

Using a single context from many threads in Entity Framework 6

Is there a way to use one dbContext in a different threads asynchronously?... var context = new Entities(); Task.Factory.StartNew(() => context.Companies.Include(x => x.Address).First()); Task.Factory.StartNew(() => context.Companies.Include(x => x.Owne...
c# entity-framework multithreading thread-safety
asked by user3049133

EF Data Context - Async/Await & Multithreading

I frequently use ...async/await... to ensure ASP.NET MVC Web API threads are not blocked by longer-running I/O and network operations, specifically database calls....The ...System.Data.Entity... namespace provides a variety of helper extensions here, such...
.net async-await c# entity-framework multithreading
asked by Alex

"Context cannot be used while the model is being created" exception with ASP.NET Identity

Why is this happening when we make a call to the AccountApiController.Register() method?...what is trying to use the context? ...what is trying to create the context? ...how do we avoid this? ...how do we debug this? ..."Message":"An error has occurred.",...
asp.net asp.net-identity c# entity-framework multithreading
asked by Shaun Luttin

Attach same object to different contexts in Entity Framework 6

From everything I read until now it should not be possible to attach same object to different dbcontexts (and all the examples and questions I could find were showing exceptions in such cases). Right now as I tested with EF6 it allowed me to attache the s...
c# entity-framework-6 multithreading
asked by user3346850

entity framework 6 - check if record exists before insert and concurrency

I have the following scenario:...A business logic function that uses ef6 checks if a record already exists. If the record does not exists, it is inserted on the database....Something like this...if (!product.Skus.Any(s => s.SkuCodeGroup == productInfo.Sku...
.net entity-framework entity-framework-6 multithreading
asked by Thiago Sayão

How to create a long running background task from MVC

I am using EF6, MVC 5 in VS 2013.I have a long running task which is causing timeout errors and so I want to set it running as a separate background task and return immediately to the web controller. The background task will report progress to an SQL serv...
asp.net-mvc async-await c# entity-framework multithreading
asked by Peter Smith

Syncronization of async EF Tasks

I am working on an Application to processes Company resources. We have a MS SQL Database and are working with EntityFramework 6.1.3 and .Net4.5. Now DbContext has async methods for example...protected Task<int> SaveChangesAsync(); ...I know that DbContext...
.net-4.5 async-await c# entity-framework-6 multithreading
asked by D4rth B4n3

Entity Framework DbContext and thread safety

I need to update a few tables in my DB in a single transaction and I read that using ...DbContext.SaveChanges... should be the way to do so. ...However I also read that the lifetime of the ...DbContext... should be as short as possible because it grows o...
asp.net-mvc c# entity-framework multithreading
asked by Idov

Entity Framework The context cannot be used while the model is being created

My unit of work class is mentioned below and I am using Ninject and I have tried injecting ...IUnitOfWork... per request per thread scope, transient etc. but I am still getting error which is:..."Message":"An error has occurred.","ExceptionMessage":"The c...
asp.net-web-api entity-framework-6 model-view-controller multithreading
asked by Salman

“Context cannot be used while the model is being created” using ASP.NET Core Console Application With EF 6

When I execute my asp.net core console application using ASP.NET Core Console Application With ...EF6.... I'm getting the following error often. ...System.InvalidOperationException: The context cannot be used while the model is being created. This excepti...
asp.net-core c# console-application entity-framework-6 multithreading
asked by Parthi

Entity Framework not using updated connection string

Is it possible to change the connection string within the app.config file and have Entity Framework start using the new values?...I have a multi-threaded app with one thread acting as the dispatcher. This thread has the ability to receive a message telli...
c# database-connection entity-framework-6 multithreading
asked by Mark Wagoner

Async/Await and Entity Framework SQL Procedure UI Thread Locking

I've been transitioning myself from BackGroundWorker to Async/Await programming. For the most part, it's been pretty simple. However, today I'm working with Entity Framework 6 and it's not playing nice. What I have here is a Procedure that I'm executing o...
asynchronous c# entity-framework-6 multithreading tsql
asked by Kayot

Is a DbContext per thread in Parallel.ForEach safe?

I am working a contract right now to increase the performance of a back end services for a modern SaaS SPA web app that is using EF 6 as their ORM. The first thing I proposed was to introduce some multi-threading to their back end service which is curren...
c# entity-framework entity-framework-6 multithreading parallel-processing
asked by Casey Chester

Page 1 of 1
  • 1

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

EF Extensions
Try for free now