Negative integers with .NET Framework 4.6

Negative integers with .NET Framework 4.6

Postby Pepsinio » Wed 01 Jul 2015 13:33

Hello,
Under .NET Framework 4.6 for every integer field which is negative in the Database (ex : -1) , when we query the database or do even a simple table list of particular model (T) contaning integer field it brings back the positive value (ex: 1) of the integer value in the Model even though the actual value is negative in the DB!
{
DbSet<T> dbSet = mContext.Set<T>();
var entries = dbSet.ToList();
}

Also, upon 'SaveChanges()' on added entity which contains negative value for integer data member, it saves it as a positive one in the DB.
That issue is occurring only on .NET Framework 4.6 RC and 4.6 Preview. Up to .NET Framework 4.5.2 it is working normally.

Database field type : NUMBER
Model field type : int
Oracle Version: 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production

DevArt.Data Version: 5.0.1199.0
DevArt.Data.Oracle Version: 8.4.407.0
DevArt.Data.Oracle.Entity Version: 8.4.407.6

This could be a serious issue. Please provide us with feedback as soon as possible.

Best wishes,
Peter
Pepsinio
 
Posts: 3
Joined: Wed 01 Jul 2015 10:55

Re: Negative integers with .NET Framework 4.6

Postby Shalex » Fri 03 Jul 2015 10:14

We cannot reproduce the issue with the latest (8.4.447) version of dotConnect for Oracle. Please upgrade. If this doesn't help, send us a small test project with the corresponding DDL/DML script for reproducing.
Shalex
Devart Team
 
Posts: 7460
Joined: Thu 14 Aug 2008 12:44

Re: Negative integers with .NET Framework 4.6

Postby Pepsinio » Thu 09 Jul 2015 11:34

Hi Alex,
I have send you an email with provided code sample
Pepsinio
 
Posts: 3
Joined: Wed 01 Jul 2015 10:55

Re: Negative integers with .NET Framework 4.6

Postby HBasler » Sun 12 Jul 2015 12:24

Hello,

i have a similar issue. I have a machine with framework 4.5.2, i retrieve Data with dbForge Studio for Oracle Pro (3.7.472) from our Server, all fine.

My second machine at Home-Office with VS2015 RC installed, the identical Query with dbForge Studio for Oracle Pro gives wrong data, all negatives integers are positive.

Here is the table (Oracle 10.2.0.5.0), the field ID returns "false positive".

CREATE TABLE SM.LAB_STATUSVERARBEITUNG (
ID NUMBER(5, 0),
BEZEICHNUNG VARCHAR2(255 BYTE) NOT NULL,
FEHLERSTATUS NUMBER(22, 0) DEFAULT 0 NOT NULL,
CONSTRAINT PK_LAB_STATUSVERARBEITUNG PRIMARY KEY (ID)
)

mfG
Helmut
HBasler
 
Posts: 1
Joined: Sun 12 Jul 2015 12:01

Re: Negative integers with .NET Framework 4.6

Postby Pepsinio » Mon 13 Jul 2015 06:19

Helmut,
after investigation we have found that the issue comes when code is compiled with the new Roslyn compiler in VS 2015. If you tick ('prefer 32bit') in project settings everything works fine, because the old compiler is used in such situation.
Alex,
please provide us with any feedback as this issue is urgent and needs to be fixed asap. Visual Studio 2015 will be released within 1 week and likewise the .NET 4.6 official framework.

Best wishes,
Peter
Pepsinio
 
Posts: 3
Joined: Wed 01 Jul 2015 10:55

Re: Negative integers with .NET Framework 4.6

Postby Shalex » Mon 13 Jul 2015 16:55

Peter,
we have reproduced the issue with the new Roslyn compiler in VS 2015 in case of the x64 mode. Thank you for the details you have specified. We are investigating the problem. JIC: it persists with a plain ADO.NET as well.

Helmut,
thank you for your report for dbForge Studio for Oracle Pro.
Shalex
Devart Team
 
Posts: 7460
Joined: Thu 14 Aug 2008 12:44

Re: Negative integers with .NET Framework 4.6

Postby vmakkenz » Wed 22 Jul 2015 12:35

Hi,

We also just ran into this issue, any news on when a fix will be available?
Is there a way to not use the new compiler, I think some of our customers will be downloading the new framework before we can deliver them an updated version of our software.

Regards,

Valentijn
vmakkenz
 
Posts: 18
Joined: Tue 26 Aug 2008 13:30

Re: Negative integers with .NET Framework 4.6

Postby Shalex » Fri 24 Jul 2015 08:23

vmakkenz wrote:We also just ran into this issue, any news on when a fix will be available?

The investigation is in progress. As soon as we have any results, we will let you know.
Shalex
Devart Team
 
Posts: 7460
Joined: Thu 14 Aug 2008 12:44

Re: Negative integers with .NET Framework 4.6

Postby vmakkenz » Wed 29 Jul 2015 06:47

Here are some methods on how to disable RyuJIT

https://github.com/Microsoft/dotnet/blob/master/docs/testing-with-ryujit.md#disable-ryujit

Method 1 worked for me
Environment SET COMPLUS_useLegacyJit=1

Method 2 worked also
But registry key name is UseRyuJIT and should be set to 0

Method 3 didn't work for me
Description: The process was terminated due to an unhandled exception.
Exception Info: System.Configuration.ConfigurationErrorsException
vmakkenz
 
Posts: 18
Joined: Tue 26 Aug 2008 13:30

Re: Negative integers with .NET Framework 4.6

Postby Shalex » Wed 29 Jul 2015 13:49

The bug with processing negative Oracle NUMBER values using the x64 mode in .NET Framework 4.6 is fixed. We will notify you when the corresponding build of dotConnect for Oracle is available for download.

With the new build, there will be no need to disable RyuJIT for this particular issue.

JIC: .NET Framework 4.6 has different issues (http://blogs.msdn.com/b/dotnet/archive/2015/07/28/ryujit-bug-advisory-in-the-net-framework-4-6.aspx), so it's not recommended to use it in the production environment currently.
Shalex
Devart Team
 
Posts: 7460
Joined: Thu 14 Aug 2008 12:44

Re: Negative integers with .NET Framework 4.6

Postby Shalex » Fri 31 Jul 2015 11:15

dotConnect for Oracle 8.5 is released: http://forums.devart.com/viewtopic.php?f=1&t=32207.
Shalex
Devart Team
 
Posts: 7460
Joined: Thu 14 Aug 2008 12:44

Re: Negative integers with .NET Framework 4.6

Postby vmakkenz » Mon 03 Aug 2015 17:46

Great, thank you works like a charm.
We don't seem to hit the other bug but do notice an significant improvement in speed.
vmakkenz
 
Posts: 18
Joined: Tue 26 Aug 2008 13:30

Re: Negative integers with .NET Framework 4.6

Postby BGrojer » Tue 18 Aug 2015 07:05

Can you provide details on the root cause for that issue?
Microsoft has fixed the RyuJIT issue but old "Devart" Version are still facing the problem. Can you confirm that?

http://blogs.msdn.com/b/dotnet/archive/2015/07/28/ryujit-bug-advisory-in-the-net-framework-4-6.aspx
BGrojer
 
Posts: 16
Joined: Thu 19 Sep 2013 12:35

Re: Negative integers with .NET Framework 4.6

Postby Shalex » Tue 18 Aug 2015 10:36

dotConnect for Oracle v8.5 includes a fix to work around peculiarity of .NET Framework 4.6 with processing negative Oracle NUMBER values in the x64 mode. Please use v8.5.
Shalex
Devart Team
 
Posts: 7460
Joined: Thu 14 Aug 2008 12:44

Re: Negative integers with .NET Framework 4.6

Postby Thorium » Wed 02 Dec 2015 14:11

What do you recommend for the existing customers that already have the software dependency to Devart 8.4 installed, and will get the Microsoft .NET Framework 4.6 at some point from Windows Update?

This has a high risk of messing the database to unrecoverable state.
Thorium
 
Posts: 4
Joined: Tue 27 Jan 2015 16:05

Next

Return to dotConnect for Oracle