Monday, September 16, 2013

Oracle and Entity Framework a bad mix

I've been working with entity framework since it came out. For so long in fact that I wrote my first EDMX file by hand instead of using the designer which wasn't finished. I get along ok with EF but for the first time this year I've been using it on an Oracle database. What a miserable experience that is!

I was unable to begin with a Code-First approach because our local DB guru created a database in the PL/SQL designer. This apparently presented no problem when creating the EDMX file except that for some reason the database was not generating unique primary key IDs for any of the rows.

A bit of digging showed that the Oracle tools refuse to propagate the StoreGeneratedPattern="Identity" back into the model so each time you do a database refresh you have to go an add these back in by hand. You could write a macro or make some sort of XDocument parser/munger to do it but why the heck should you?

Another problem is that the Oracle EF components are uniquely 32 bit. This has proven to be a nuisance when writing for a system that cam pre-loaded with the corporate 64 bit drive image.

Ellison's hate of all things Microsoft shine through on this one. If you have a choice of database. Go with SQL Server.

No comments: