Thoughts from Dan Miser RSS 2.0
# Friday, September 23, 2005
I was preparing a writeup on how LINQ handles IDENTITY fields, and there is some mixed news on this front. First off, the good news. The concept of how LINQ will deal with IDENTITY fields is quite solid. The goal is to have the DB return the new value for the IDENTITY field and then populate the object with that new value. Very slick. Back in Delphi 5, MIDAS introduced a property TDatasetProvider.ProviderOptions.poAutoRefresh that was supposed to do this same thing. However, it was never implemented, so it never worked. As a result, you had to use other options, like the one I outlined in my BDN article. So LINQ has a definite advantage here.

The other really cool things about LINQ IDENTITY handling is that you can build up a graph of objects (i.e. Orders and OrderDetails), add the object to a Customer object, and when you do a SubmitChanges(), the IDENTITY fields are updated properly throughout the whole object graph, in addition to linking properly in the DB.

However, the bad news is that the DLINQ implementation is throwing a System.InvalidOperationException because "There is already an open DataReader associated with this Command which must be closed first.". If you are debugging the application and pause long enough before continuing, the data will still get written to the DB. However, I have not been able to get the application to work at all when just running it (i.e. Start Without Debugging). I believe it may be due to my mixed use of retrieving a customer from the DB using LINQ, and then creating Order and OrderDetail objects locally and adding them to the Customer object. I say this because doing a simple add of a Category object all by itself doesn't yield this exception. I also had an instance one time where only the Order was inserted, and not the OrderDetail, thereby invalidating the atomicity of the transaction. I plan on cleaning up the test case and submitting it to MS. Anyone know where this kind of feedback should go?

Friday, September 23, 2005 5:58:00 PM (GMT Daylight Time, UTC+01:00)  #    Comments [4] -
Delphi
Tracked by:
http://9qg-information.info/92458676/index.html [Pingback]
http://9ov-information.info/52267671/spanish-radio-michigan.html [Pingback]
http://9os-information.info/68539510/the-oaklahoma-city-bombing.html [Pingback]
http://9ok-information.info/85626302/western-australian-racing-machines.html [Pingback]
http://9qg-information.info/87984434/index.html [Pingback]
http://9qp-information.info/34466156/index.html [Pingback]
http://9ov-information.info/90446774/index.html [Pingback]
http://9oq-information.info/22768149/index.html [Pingback]
http://9rj-information.info/30408131/index.html [Pingback]
http://9sg-information.info/01568596/index.html [Pingback]
http://9sr-information.info/27135332/index.html [Pingback]
http://9rb-information.info/94778034/inflatable-christian-nativity-scenes.html [Pingback]
http://9rb-information.info/78336125/index.html [Pingback]
http://9re-information.info/77692574/index.html [Pingback]
http://9rr-information.info/97244128/harrah-s-casino-flight-department.html [Pingback]
http://9sp-information.info/47916043/sito-tifoso-ischia.html [Pingback]
http://9rw-information.info/44885884/index.html [Pingback]
http://9sf-information.info/55980891/portale-arte.html [Pingback]
http://9re-information.info/64797360/index.html [Pingback]
http://9rl-information.info/97037118/index.html [Pingback]
http://9rb-information.info/01616994/index.html [Pingback]
http://9uaef-le-informazioni.info/37313239/hotel-val-martello.html [Pingback]
http://9uaei-le-informazioni.info/51522123/index.html [Pingback]
http://9uael-le-informazioni.info/98183652/labx.html [Pingback]
http://9uafe-le-informazioni.info/73542180/index.html [Pingback]
http://9uaen-le-informazioni.info/82919794/index.html [Pingback]
http://9uafj-le-informazioni.info/73073282/catarro-retronasale-alitosi.html [Pingback]
http://9uafq-le-informazioni.info/09912757/saldatrice-usata.html [Pingback]
http://9uaet-le-informazioni.info/93146899/fiera-dei-fumetti.html [Pingback]
http://9uaff-le-informazioni.info/82086342/index.html [Pingback]
http://9uaff-le-informazioni.info/31355800/baume-mercier-italia.html [Pingback]
http://9uafp-le-informazioni.info/93473537/index.html [Pingback]
http://9uafq-le-informazioni.info/39616216/index.html [Pingback]
http://9uaem-le-informazioni.info/69481126/philips-plasma-hd.html [Pingback]
http://9uafk-le-informazioni.info/63668675/www-istruzione-lombardia-milano-it.ht... [Pingback]
http://9uafm-le-informazioni.info/08033175/index.html [Pingback]
http://9uafs-le-informazioni.info/05544848/rimor-europeo.html [Pingback]
http://9uags-le-informazioni.info/32786957/index.html [Pingback]
http://9uahn-le-informazioni.info/13041250/index.html [Pingback]
http://9uago-le-informazioni.info/71926456/ghost-10.html [Pingback]
http://9uagi-le-informazioni.info/91813978/index.html [Pingback]
http://9uags-le-informazioni.info/34808688/index.html [Pingback]
http://9uagh-le-informazioni.info/68834064/index.html [Pingback]
http://9uagm-le-informazioni.info/72172594/benedetto-sia-l-giorno.html [Pingback]
http://9uahs-le-informazioni.info/39159413/index.html [Pingback]
http://9uaho-le-informazioni.info/37255682/index.html [Pingback]
http://9uahf-le-informazioni.info/68562042/index.html [Pingback]
http://9uagh-le-informazioni.info/21403819/index.html [Pingback]
http://9uagd-le-informazioni.info/92893941/marco-spinosa.html [Pingback]
http://9uahg-le-informazioni.info/79967790/index.html [Pingback]
http://9uahn-le-informazioni.info/33898305/index.html [Pingback]
http://9uagb-le-informazioni.info/13914007/index.html [Pingback]
http://9uagd-le-informazioni.info/48763460/index.html [Pingback]
http://9uahd-le-informazioni.info/28117813/club-follia.html [Pingback]
Navigation
Archive
<November 2014>
SunMonTueWedThuFriSat
2627282930311
2345678
9101112131415
16171819202122
23242526272829
30123456
Blogroll
About the author/Disclaimer

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

© Copyright 2014
Dan Miser
Sign In
Statistics
Total Posts: 388
This Year: 0
This Month: 0
This Week: 0
Comments: 630
Themes
Pick a theme:
All Content © 2014, Dan Miser
DasBlog theme 'Business' created by Christoph De Baene (delarou)