Oracle EF too accurate ;)
Oracle EF too accurate ;)
Hi,
I have a small problem with EF and Oracle. I have a field that is defined NUMBER(9,6).
I'm updating this field with
update table
set field = 7.2290079999999994
Select on this field gives me 7,229008. Same result with plain old ADO.NET.
But if I get this field with EF I get... 7.2290079999999994.
Why?
PS. Guess what happens if you use optimistic concurrency?
update table
set something
where field = 7.2290079999999994
Best regards!
I have a small problem with EF and Oracle. I have a field that is defined NUMBER(9,6).
I'm updating this field with
update table
set field = 7.2290079999999994
Select on this field gives me 7,229008. Same result with plain old ADO.NET.
But if I get this field with EF I get... 7.2290079999999994.
Why?
PS. Guess what happens if you use optimistic concurrency?
update table
set something
where field = 7.2290079999999994
Best regards!
Oracle server converts double precision value to 7.2290079999999994, no matter what value it was set between
7.2290079000000000 to 7.2290079999999999.
The problem is associated with Double comparison.
More details are available here:
http://msdn.microsoft.com/en-us/library/ya2zha7s.aspx
So far there is no workaround for this problem. I will let you know if any solution is available.
7.2290079000000000 to 7.2290079999999999.
The problem is associated with Double comparison.
More details are available here:
http://msdn.microsoft.com/en-us/library/ya2zha7s.aspx
So far there is no workaround for this problem. I will let you know if any solution is available.
Are you sure thats the problem
Hi,
I'm afraid I don't quite understand.
Oracle converts the values from between 7.2290079000000000 and 7.2290079999999999 to 7.2290079999999994 disregarding the NUMBER(9,6) definition. Good for you Oracle! :/
But leaving Oracle aside. How do you manage to read this value from database. I'm reading this value in SQLPlus i get 7.229008. If I use pure ADO.NET I get 7.229008. And in EF I get 7.2290079999999994. Good for you devart! :/
That afterwards by concurrency check comparison between 7.2290079999999994 and 7.229008 gives false is perfectly right. But that is not a problem. How do I get out from this situation (and I don't to turn off the concurrency check for this column!)?
Best regards!
I'm afraid I don't quite understand.
Oracle converts the values from between 7.2290079000000000 and 7.2290079999999999 to 7.2290079999999994 disregarding the NUMBER(9,6) definition. Good for you Oracle! :/
But leaving Oracle aside. How do you manage to read this value from database. I'm reading this value in SQLPlus i get 7.229008. If I use pure ADO.NET I get 7.229008. And in EF I get 7.2290079999999994. Good for you devart! :/
That afterwards by concurrency check comparison between 7.2290079999999994 and 7.229008 gives false is perfectly right. But that is not a problem. How do I get out from this situation (and I don't to turn off the concurrency check for this column!)?
Best regards!