Page 1 of 1

BUG: superfluous digits returned - EF and non direct mode

Posted: Tue 10 Aug 2010 12:08
by jpl
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.

Posted: Thu 12 Aug 2010 11:55
by AndreyR
Thank you for the report, we are investigating the problem.
I will let you know about the results of our investigation.

Posted: Thu 09 Sep 2010 16:07
by AndreyR
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).

Posted: Fri 17 Sep 2010 11:14
by jpl
I am not sure to understand very well.

Is there something to do ?
Will you do something ?

Posted: Thu 23 Sep 2010 13:46
by AndreyR
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.