Problems with Entity Framework and Oracle sequence ID
Posted: Thu 18 Sep 2008 14:47
The following applies to my problem:
OraDirect.NET ver. 4.75.39.0
Oracle 10
My EDM is exposed to client via ADO.NET Data Services. Reading from EDM works well; also INSERT when specifying an ID (for MyTableID below) on the client, works. But we need to adhere to our database standards which uses a trigger to assign sequence value to primary keys.
sample code:
MyObjectType newObject = new MyObjectType();
IEdmDataService myContext = new EdmDataService();
newObject.SomeProps = .....
myContext.AddObject("MyObjectType", newObject);
myContext.SaveChanges();
.SaveChanges throws:
System.Data.Services.Client.DataServiceRequestException: An error occurred while processing this request. ---> System.Data.Services.Client.DataServiceClientException: System.InvalidOperationException: The serialized resource has a null value in key member 'MyTableID'. Null values are not supported in key members.
I HAVE set (in EDM model .edmx SSDL section) the following
...but still no success; I get the same ex for alle possible vals of StoreGeneratedPattern.
-Is it a problem that my ID is varchar2 and not an integer type? (Nope not...)
-To MS; why do I have to edit the EDM in XML editor to set props like StoreGeneratedPattern....?
any ideas...?
OraDirect.NET ver. 4.75.39.0
Oracle 10
My EDM is exposed to client via ADO.NET Data Services. Reading from EDM works well; also INSERT when specifying an ID (for MyTableID below) on the client, works. But we need to adhere to our database standards which uses a trigger to assign sequence value to primary keys.
sample code:
MyObjectType newObject = new MyObjectType();
IEdmDataService myContext = new EdmDataService();
newObject.SomeProps = .....
myContext.AddObject("MyObjectType", newObject);
myContext.SaveChanges();
.SaveChanges throws:
System.Data.Services.Client.DataServiceRequestException: An error occurred while processing this request. ---> System.Data.Services.Client.DataServiceClientException: System.InvalidOperationException: The serialized resource has a null value in key member 'MyTableID'. Null values are not supported in key members.
I HAVE set (in EDM model .edmx SSDL section) the following
...but still no success; I get the same ex for alle possible vals of StoreGeneratedPattern.
-Is it a problem that my ID is varchar2 and not an integer type? (Nope not...)
-To MS; why do I have to edit the EDM in XML editor to set props like StoreGeneratedPattern....?

any ideas...?