BUG: superfluous digits returned - EF and non direct mode

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
jpl
Posts: 13
Joined: Fri 12 Sep 2008 14:47

BUG: superfluous digits returned - EF and non direct mode

Post by jpl » Tue 10 Aug 2010 12:08

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.

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Thu 12 Aug 2010 11:55

Thank you for the report, we are investigating the problem.
I will let you know about the results of our investigation.

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Thu 09 Sep 2010 16:07

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).

jpl
Posts: 13
Joined: Fri 12 Sep 2008 14:47

Post by jpl » Fri 17 Sep 2010 11:14

I am not sure to understand very well.

Is there something to do ?
Will you do something ?

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Thu 23 Sep 2010 13:46

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.

Post Reply