Geeks With Blogs

The Life and Times of a Dev Yes, we're really that weird

Ran into an interesting bug today.  I’m working with a client that’s using .net 4.5.1, EF 6.1.3, and is in the process of upgrading to SQL Server 2016.

When we did the update, we suddenly had entities that were being detected as being different, even though the data was exactly the same.  This was causing us to get unexpected concurrency exceptions.

The following sql would be generated by entity framework:

exec sp_executesql N'UPDATE [dbo].[MyTable]
SET [StateLastChangedDate] = @0
WHERE (([Id] = @1) AND ([LastEdited] = @2))
SELECT [LastEdited]
FROM [dbo].[MyTable]
WHERE @@ROWCOUNT > 0 AND [Id] = @1',N'@0 datetime2(7),@1 uniqueidentifier,@2 binary(8)',@0='2016-08-04 17:28:17.2366667',@1='FC66D162-1801-409C-8574-4B1900C72B2E',@2=0x0000000000004D3B

StateLastChangedDate would be identical to what it was previously.  Same ticks and everything.

We found two solutions:

1.  Change the compatibility mode to Sql Server 2014

2.  Upgrade to .net 4.6.2

Both seemed to eliminate the issue with a field being detected as being changed when it shouldn’t have been.

Posted on Thursday, August 4, 2016 12:07 PM | Back to top


Comments on this post: Sql Server 2016, Entity Framework and .net 4.5.1

# re: Sql Server 2016, Entity Framework and .net 4.5.1
Requesting Gravatar...
If you are annoyed like me with unwanted mails filling up your Gmail space and want to block the all the unwanted mails in one go?
Block Unwated emails gmail.com
Left by Havijjer on Aug 07, 2016 1:57 AM

# re: Sql Server 2016, Entity Framework and .net 4.5.1
Requesting Gravatar...
here is how u can check ur aadhar card status Easiest step possible
Left by daniels danny on Nov 04, 2016 5:02 AM

# re: Sql Server 2016, Entity Framework and .net 4.5.1
Requesting Gravatar...
aadhar card verification check this and verified your details:
eaadhar card status
Left by mohan4795 on Nov 24, 2016 12:29 AM

# re: Sql Server 2016, Entity Framework and .net 4.5.1
Requesting Gravatar...
Great! I loved your blog. Great informative website.
thinnest phone
Left by ank on Nov 28, 2016 3:40 PM

# re: Sql Server 2016, Entity Framework and .net 4.5.1
Requesting Gravatar...
Wifikill is an amazing Android mobile application that helps you in disabling the other people from using your wifi network. you can get it from here Download WiFiKill apk
Left by WiFi Kill for android on Dec 06, 2016 6:22 AM

# re: Sql Server 2016, Entity Framework and .net 4.5.1
Requesting Gravatar...
Record video selfie animations, change the way you look and send it to friends via your favorite messengers and social networks.
msqrd app
Left by msqrd for windows on Dec 06, 2016 6:24 AM

# re: Sql Server 2016, Entity Framework and .net 4.5.1
Requesting Gravatar...
click here Dubai UAE Airport

Left by badra on Jan 27, 2017 7:34 AM

# re: Sql Server 2016, Entity Framework and .net 4.5.1
Requesting Gravatar...
Consumers can get referral bonuses, and merchants can get cashbacks, soon, under the Union Government of India’s Budget scheme to incentivise use of bhim app.
bhim app


Left by Archita Gupta on Feb 08, 2017 11:14 PM

# re: Sql Server 2016, Entity Framework and .net 4.5.1
Requesting Gravatar...
Showbox indeed is one of the best apps among all the others which provide streaming of movies and tv shows.
The best part is, it is absolutely free for everyone and it also provides multiple resolution of the videos Showbox App
Left by Mark Webber on Feb 23, 2017 12:29 AM

# re: Sql Server 2016, Entity Framework and .net 4.5.1
Requesting Gravatar...
Fast and Furious 8 will be epic. I am so eagerly waiting for this movie since 2015. Paul walker will always stay in our heart. You can check out all the details regarding this movie from my site. #RIP Paul Walker. Fast and Furious 8
Left by Calvin Den on Feb 23, 2017 11:16 PM

# low price
Requesting Gravatar...
List of all the latest and new mobile phones best under price.
Left by best on Feb 24, 2017 5:38 AM

# re: Sql Server 2016, Entity Framework and .net 4.5.1
Requesting Gravatar...
Thank you soo much for this amazing blog. You can download Showbox APK from here
Left by Showbox on Feb 27, 2017 11:42 PM

# re: Sql Server 2016, Entity Framework and .net 4.5.1
Requesting Gravatar...
hey download
cartoon hd easily from here its the best direct link available on net.
Left by Showbox on Feb 27, 2017 11:43 PM

# re: Sql Server 2016, Entity Framework and .net 4.5.1
Requesting Gravatar...
Thank you buddy, I love this :) <a href=‘https://geometrydashi.com/'>Play Geometry dash online
Left by geometry dash on Mar 12, 2017 9:54 AM

# re: Sql Server 2016, Entity Framework and .net 4.5.1
Requesting Gravatar...
Left by geometry dash on Mar 12, 2017 9:55 AM

# re: Sql Server 2016, Entity Framework and .net 4.5.1
Requesting Gravatar...
The Sims Mobile will officially release almost immediately for android and iOS, the game soft-launched for Brazilian players. If you can’t catch the Brazilian version, prospects are still available for you by downloading thesimsmobile game apk file on your android device.
Left by apkpipe on May 29, 2017 4:01 AM

# re: Sql Server 2016, Entity Framework and .net 4.5.1
Requesting Gravatar...
Thanks for that, it's a very helpful info [url=http://descargargeometrydashgratis.com]juegar Geometry Dash online[/url]
Left by George on Jun 05, 2017 9:13 AM

# re: Sql Server 2016, Entity Framework and .net 4.5.1
Requesting Gravatar...
Thanks for that, it's a very helpful info jugar Geometry Dash online
Left by George on Jun 05, 2017 9:14 AM

# re: Sql Server 2016, Entity Framework and .net 4.5.1
Requesting Gravatar...
enjoy this Download Game Guardian Apk best game modifier app.
Left by am on Jun 07, 2017 7:11 AM

# re: Sql Server 2016, Entity Framework and .net 4.5.1
Requesting Gravatar...
Nice to read some fressh content, it's like descargar los sims mobile and play where you want.
Left by charles on Jun 14, 2017 8:44 AM

# re: Sql Server 2016, Entity Framework and .net 4.5.1
Requesting Gravatar...
Az Screen Recorder Apk

Shareit for laptop



Nice

Left by Pranshu Kharkwal on Jun 20, 2017 1:25 AM

# re: Sql Server 2016, Entity Framework and .net 4.5.1
Requesting Gravatar...
Buen contenido, la verdad que se agradece para los entendidos del mundo geek! es como si estás buscando descargar sims 4 gratis y no lo encuentras.
Left by Rupia on Jun 20, 2017 9:12 AM

# re: Sql Server 2016, Entity Framework and .net 4.5.1
Requesting Gravatar...
Nice bug, i didn't know that one
Left by Chris on Jun 26, 2017 8:53 AM

# re: Sql Server 2016, Entity Framework and .net 4.5.1
Requesting Gravatar...
That's a new bug for me, not know that one, thanks for sharing this info with all of us, will be helpful for use some brawl stars hack without problems.
Left by Gonzalo on Jun 26, 2017 8:56 AM

# re: Sql Server 2016, Entity Framework and .net 4.5.1
Requesting Gravatar...
Nice info about that bug, maybe you can share some photos on pinterest gratis so more people know about that issue.
Left by Elena on Jun 26, 2017 10:40 AM

# re: Sql Server 2016, Entity Framework and .net 4.5.1
Requesting Gravatar...
Thanks for the info mate!
Left by Alexander on Jun 28, 2017 11:11 AM

# re: Sql Server 2016, Entity Framework and .net 4.5.1
Requesting Gravatar...
Ei thanks for this post, this is very good info, maybe not as the info that I'm searching but it's ok to descargar clash royale hack in internet.
Left by Paul on Jun 28, 2017 11:14 AM

# re: Sql Server 2016, Entity Framework and .net 4.5.1
Requesting Gravatar...
Everyone has ever had to download Play Store Download, which is also called Google Play. This tends to happen especially when to acquire a China base technology that does not have Google apps reinstalled and when we give away or buy a second-hand root terminal, many of whom also have this package installed applications including the store is the officer of Google apps.
Left by Vikas Kumar on Jul 03, 2017 1:18 AM

# re: Sql Server 2016, Entity Framework and .net 4.5.1
Requesting Gravatar...
Very good information, hope that it will be good in my projects because have some problems programming a website about descargar minecraft gratis and have some problems with it.
Left by Erick on Jul 19, 2017 3:04 AM

# re: Sql Server 2016, Entity Framework and .net 4.5.1
Requesting Gravatar...
thank you so much for this post
geometry dash world
Left by kimmy on Aug 04, 2017 12:36 PM

# re: Sql Server 2016, Entity Framework and .net 4.5.1
Requesting Gravatar...
Wow, what an interesting article. I have enjoyed reading it and I am happy that although you encountered several problems you were able to provide immediate solutions that kept you working on the client’s task. Thanks so much for sharing the article with us and I will be recommending it to our Affordable Personal Statement Writers .
Left by Personal Statement Writers on Aug 07, 2017 4:03 AM

# re: Sql Server 2016, Entity Framework and .net 4.5.1
Requesting Gravatar...
Great job with this post, is nearly related to the santa muerte topic.

If you want to check my site, is the next: clic aquí para ver mi blog

Regards.
Left by Diego on Aug 07, 2017 4:05 PM

# re: Sql Server 2016, Entity Framework and .net 4.5.1
Requesting Gravatar...
Nice info here, congrats to the redactor of this article, maybe there are some people here inteterested in use a hay day hack for his game? if yes you now know that way :)
Left by George on Sep 06, 2017 3:19 AM

# re: Sql Server 2016, Entity Framework and .net 4.5.1
Requesting Gravatar...
Root Checker is an Android Application which allows you to check whether your Android phone or tablet is rooted or not
root checker apk
Left by root checker apk on Oct 04, 2017 7:12 AM

# re: Sql Server 2016, Entity Framework and .net 4.5.1
Requesting Gravatar...
Thanks for the info mate!
tally erp 9 crack
Left by TALLY on Oct 15, 2017 2:22 AM

# Xmodgames APK
Requesting Gravatar...
Gaming is transformed completely with the collaboration of technology and android operating system. Games have been makeover by the android platform. In doing so, app developers come up with the idea of game mod. Download Xmod mod is nothing but the bypassing of in-app purchases. In simple words, download game mod will enable the player to play the game without having to make any purchases in the game. Everything is for FREE!
Left by JesseJStarkey on Feb 26, 2018 12:49 AM

# XmodGame Apk DoodleKit
Requesting Gravatar...
Nowadays smartphones evolved in business, professionals, entertainments and many more places. People from remote areas are also using smartphones.While speaking of Xmodgames Apk, game playing is popular to spend spare time., Andriod’s newer versions of Graphics Processing Unit which lightens the load on CPU especially when running graphics applications like games or 3D graphics apps.
Left by arthurshipman on Feb 26, 2018 5:28 AM

# re: Sql Server 2016, Entity Framework and .net 4.5.1
Requesting Gravatar...
Your post is well detailed and well understood. Of a truth, there are many of the points mentioned above am coming across for the first time but I clearly understand it. I hope someday you'll continue posting.
Left by Mumbai to Goa car package on Mar 09, 2018 2:35 AM

# Http Injector
Requesting Gravatar...
We generally connect our device with free public Wi-Fi over railway stations or such other places despite knowing that they are not secured. From the safety point of view, there exists one tool named Download http injector for Pc which will help you protect the data of your device that can be easily hacked by the users of such unprotected wifi networks.
http://httpinjectorlatestapp.com/
Left by WilliamEFrench on Mar 20, 2018 5:09 AM

# re: Sql Server 2016, Entity Framework and .net 4.5.1
Requesting Gravatar...
The Andhra Pradesh Board of Intermediate Education exams was commenced from February 28th, 2018 to March 17th, 2018. After completing the exams, the correction details and the date of the AP Inter Results will be announced.
Left by examresultscgg on Mar 26, 2018 6:32 AM

# re: Sql Server 2016, Entity Framework and .net 4.5.1
Requesting Gravatar...
The Andhra Pradesh Board of Intermediate Education exams was commenced from February 28th, 2018 to March 17th, 2018. After completing the exams, the correction details and the date of the AP Inter Results will be announced.

examresults.ap.nic.in 2018
Left by examresultscgg on Mar 26, 2018 6:33 AM

Your comment:
 (will show your gravatar)


Copyright © Robert May | Powered by: GeeksWithBlogs.net