I have a trouble with the use of Entity Framework and non direct mode. If I have the following binding :
Table A, COLUMN A NUMBER(4,3)
Mapping EF : A.A -> A.Value is made in double
Sometimes, depending on the value in the database, I get exceeding digits in the returned query. Say I have 0,945 in the column A.A :
direct mode : ObjectContext.As.First() return a A object with A.Value = 0,945 it's ok
non direct mode : ObjectContext.As.First() return a A object with A.Value = 0,94500006 it's not ok !
This leads to IHM bugs in my application since I switched from direct to non direct mode.
BUG: superfluous digits returned - EF and non direct mode
The problem is associated with the fact that we receive a "wrong" byte array from OCI.
ODP.NET 10.2 returns the same Double value.
MS Oracle Client returns a precise Double, but this is implemented as getting Oracle NUMBER as CLR Decimal with latter cast to double. This approach influences the performance and can lead to overflow (System.Decimal capacity is less than Oracle NUMBER).
ODP.NET 10.2 returns the same Double value.
MS Oracle Client returns a precise Double, but this is implemented as getting Oracle NUMBER as CLR Decimal with latter cast to double. This approach influences the performance and can lead to overflow (System.Decimal capacity is less than Oracle NUMBER).
We do not plan to change this behaviour.
The simplest solution is to correct the types of the fields that were mapped as double by default. You should change the SSDL type from "double" to "decimal" and the CSDL type from System.Double to System.Decimal.
In case you are using .edml models these operations can be performed in design time (Model.Store provides design time access to the storage model), in case you are using .edml models you will have to use XML Editor.
I have performed a test, this manual mapping change works fine.
The simplest solution is to correct the types of the fields that were mapped as double by default. You should change the SSDL type from "double" to "decimal" and the CSDL type from System.Double to System.Decimal.
In case you are using .edml models these operations can be performed in design time (Model.Store provides design time access to the storage model), in case you are using .edml models you will have to use XML Editor.
I have performed a test, this manual mapping change works fine.