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 10:58:00 AM (Central Standard Time, UTC-06: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]
Friday, September 23, 2005 1:18:00 PM (Central Standard Time, UTC-06:00)
Dan, I understand you and many other's excitement about LINQ. There are things to get excited about, but a lot of what people are getting excited about is available _now_ in production form, not beta or in the labs. It's called Delphi and ECO.



"So LINQ has a definite advantage here."



It's an advantage because I am sure it works well with MSSQL. How is it working with the numerous databases MIDAS supports? I find it interesting we're comparing technology introduced in 1997, MIDAS, with something still in the cooker in 2005.



"The other really cool things about LINQ IDENTITY handling is that you can build up a graph of objects ..."



Again, ECO, ECO, ECO. ECO does the exact same thing. The objects awaiting update are called DirtyObjects. Apply their to your persistence storage, presto... done. Not only are the objects related, but the relationships themselves are objects which can queried and manipulated. Not sure if DLINQ does that.



Give ECO a try. You'll be impressed.
Kyle A. Miller
Friday, September 23, 2005 1:59:00 PM (Central Standard Time, UTC-06:00)
Hehe. I know what you're saying, Kyle. In some ways, the reason I'm digging LINQ so much is that it reminds me of MIDAS (not on a feature by feature level, per se, but more on an "Ah, this speaks to me" level).



As for ECO, I'm sure it's quite capable. I don't have Architect, and have no plans to get it any time soon. I'm doing MIDAS daily, so that also takes away from ECO learning time. I look forward to seeing ECO mature and grow, and I'll probably have to take a peek sometime in the future.
Wednesday, September 28, 2005 9:46:00 AM (Central Standard Time, UTC-06:00)
Identity fields are typically returned as an output parameter of the stored procedure performing the insert. Objects that perform the insert on the client pc automatically see the identity field via the output parameter of the stored procedure and the resulting command parameter object(s) so this isn't anything new. There's a lot of legacy code out there and I don't see a lot of companies converting to dlinq unless there's ROI Value. All of this functionality is currently available and relatively straightforward already. For new development, perhaps, once the wrinkles are ironed out. It's an interesting technology though :).
Anand Deshpande
Wednesday, February 15, 2006 10:30:00 AM (Central Standard Time, UTC-06:00)
where I can find info on LINQ. I'm using the Delphi 2005 platform
Comments are closed.
Navigation
Archive
<August 2008>
SunMonTueWedThuFriSat
272829303112
3456789
10111213141516
17181920212223
24252627282930
31123456
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 2008
Dan Miser
Sign In
Statistics
Total Posts: 307
This Year: 22
This Month: 1
This Week: 1
Comments: 604
All Content © 2008, Dan Miser
DasBlog theme 'Business' created by Christoph De Baene (delarou)