Solved

Entity Framework and Linq queries

Posted on 2014-01-15
3
324 Views
Last Modified: 2016-02-10
Hi guys,

Ok this is a bit of a general question. We started using entity framework, dragging the tables across from the data source window (as grids) and letting EF do the binding. But this soon started getting messy with links and removing all auto generated code when removing grids etc. So I started to write Linq queries linking to EF and populating the grid with the Linq results.

Will we run into problems with this if 2 users fire the same query to the database at the same time or will EF manage this? in terms of saving data and returning a unique ID

My boss asked a valid question in that why are we using EF if its not doing the binding for us and why don't we go back to our own method of doing our own database connection, firing SQL queries, getting results and closing database connection?

I know this is an odd question but I was just looking for general advice and possibly your opinions on how you do things.
0
Comment
Question by:deanlee17
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 16

Accepted Solution

by:
Imran Javed Zia earned 500 total points
ID: 39781929
Yes EF take cares of auto generated/identity fields in dbms like sql server and etc, but you may have to address them manually in dbms like oracle.

 
It all depends on your requirement, please refer to following general discussions:
http://www.bishoylabib.com/2012/01/why-entity-framework-is-better-than-ado.net
stackoverflow.com/questions/9811106/entity-framework-vs-ado-net
http://forums.asp.net/p/1686009/4441548.aspx?EF+Frustrations

Thanks
0
 

Author Comment

by:deanlee17
ID: 39782273
Great info in the links. Ok so if I had a scenario where I have 2 users uploading 10,000 records at once it would complete one users database inserts before moving on to the second user?
0
 
LVL 16

Expert Comment

by:Imran Javed Zia
ID: 39782373
As per my understanding, either you use ado.net or EF, in such scenario, you have to manually implement transactions or semaphore (lock statement) as per requirements.

Like if there is requirement that when 1st batch is in process then the 2nd batch may not execute in such case you may use semaphore, alternatively you may use transaction.
0

Featured Post

Veeam gives away 10 full conference passes

Veeam is a VMworld 2017 US & Europe Platinum Sponsor. Enter the raffle to get the full conference pass. Pass includes the admission to all general and breakout sessions, VMware Hands-On Labs, Solutions Exchange, exclusive giveaways and the great VMworld Customer Appreciation Part

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A basic question.. “What is the Garbage Collector?” The usual answer given back: “Garbage collector is a background thread run by the CLR for freeing up the memory space used by the objects which are no longer used by the program.” I wondered …
Recently while returning home from work my wife (another .NET developer) was murmuring something. On further poking she said that she has been assigned a task where she has to serialize and deserialize objects and she is afraid of serialization. Wha…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

622 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question