Bug by Save int.MinValue in EFCore

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
seb1487
Posts: 22
Joined: Fri 24 Jun 2016 10:27

Bug by Save int.MinValue in EFCore

Post by seb1487 » Wed 09 Nov 2016 14:01

Hi Shalex,
dotConnect throws an error by save a int.MinValue or long.MinValue

Code: Select all

var myObject = new Class1();
myObject.Number1 = int.MinValue;
myObject.Number2 = long.MinValue;

dbContext.Class1.Add(myObject);
dbContext.SaveChanges();
StackTrace:

Code: Select all

Microsoft.EntityFrameworkCore.DbUpdateException was unhandled
  HResult=-2146233088
  Message=An error occurred while updating the entries. See the inner exception for details.
  Source=Microsoft.EntityFrameworkCore.Relational
  StackTrace:
       bei Microsoft.EntityFrameworkCore.Update.ReaderModificationCommandBatch.Execute(IRelationalConnection connection)
       bei Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.Execute(IEnumerable`1 commandBatches, IRelationalConnection connection)
       bei Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChanges(IReadOnlyList`1 entriesToSave)
       bei Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChanges(Boolean acceptAllChangesOnSuccess)
       bei Microsoft.EntityFrameworkCore.DbContext.SaveChanges(Boolean acceptAllChangesOnSuccess)
       bei DevartFindBugTool.Program.Main(String[] args) in C:\Projects\DevartFindBugTool\src\DevartFindBugTool\Program.cs:Zeile 22.
  InnerException: System.OverflowException
       HResult=-2146233066
       Message=Negating the minimum value of a twos complement number is invalid.
       Source=mscorlib
       StackTrace:
            bei System.Math.AbsHelper(Int32 value)
            bei Devart.Data.Oracle.ds.b()
            bei Devart.Data.Oracle.af.b()
            bei Devart.Data.Oracle.l.a(af A_0, Int32 A_1)
            bei Devart.Data.Oracle.l.a(Int32 A_0, z A_1)
            bei Devart.Data.Oracle.OracleCommand.InternalExecute(CommandBehavior behavior, IDisposable disposable, Int32 startRecord, Int32 maxRecords, Boolean nonQuery)
            bei Devart.Common.DbCommandBase.ExecuteDbDataReader(CommandBehavior behavior, Boolean nonQuery)
            bei Devart.Data.Oracle.Entity.av.a(CommandBehavior A_0)
            bei Devart.Common.Entity.c.b(CommandBehavior A_0)
            bei Devart.Data.Oracle.Entity.av.b(CommandBehavior A_0)
            bei Microsoft.EntityFrameworkCore.Storage.Internal.RelationalCommand.Execute(IRelationalConnection connection, String executeMethod, IReadOnlyDictionary`2 parameterValues, Boolean openConnection, Boolean closeConnection)
            bei Microsoft.EntityFrameworkCore.Storage.Internal.RelationalCommand.ExecuteReader(IRelationalConnection connection, IReadOnlyDictionary`2 parameterValues, Boolean manageConnection)
            bei Microsoft.EntityFrameworkCore.Update.ReaderModificationCommandBatch.Execute(IRelationalConnection connection)
       InnerException: 
Democode can be downloaded here.

Pinturiccio
Devart Team
Posts: 2141
Joined: Wed 02 Nov 2011 09:44

Re: Bug by Save int.MinValue in EFCore

Post by Pinturiccio » Fri 11 Nov 2016 12:15

We have reproduced the issue. We will investigate it and post here about the results as soon as possible.

Shalex
Devart Team
Posts: 8088
Joined: Thu 14 Aug 2008 12:44

Re: Bug by Save int.MinValue in EFCore

Post by Shalex » Thu 09 Feb 2017 19:42

The issue is fixed in the newest (9.2.205) build of dotConnect for Oracle.

Post Reply