Page 1 of 1

Object Null Ref when save changes adding new entity

Posted: Mon 11 Jul 2016 07:14
by thoho
Object reference not set to an instance of an object

Code: Select all

at Devart.Common.Entity.ak.l()
   at Microsoft.EntityFrameworkCore.Storage.RelationalLoggerExtensions.LogCommandExecuted(ISensitiveDataLogger logger, DbCommand command, Int64 startTimestamp, Int64 currentTimestamp)
   at Microsoft.EntityFrameworkCore.Storage.Internal.RelationalCommand.Execute(IRelationalConnection connection, String executeMethod, IReadOnlyDictionary`2 parameterValues, Boolean openConnection, Boolean closeConnection)
   at Microsoft.EntityFrameworkCore.Storage.Internal.RelationalCommand.ExecuteReader(IRelationalConnection connection, IReadOnlyDictionary`2 parameterValues, Boolean manageConnection)
   at Microsoft.EntityFrameworkCore.Update.ReaderModificationCommandBatch.Execute(IRelationalConnection connection)
Reproduce step:
Devart.Data.MySql.Entity.EFCore.dll, 8.6.687.0
net451, dotnet core 1.0.0-RTM

_dbcontext.Registrations.Add(new ABC{
Name = "abc",
// Username = ?, Not null column, but not define required
});
_dbcontext.SaveChanges();

Expected: MySQL error message
Actual: Object reference not set to an instance of an object

Re: Object Null Ref when save changes adding new entity

Posted: Wed 13 Jul 2016 16:55
by Shalex
Thank you for the report. We are processing your request.

Re: Object Null Ref when save changes adding new entity

Posted: Mon 18 Jul 2016 15:46
by Shalex
We cannot reproduce the issue in our environment. Please send us a small test project with the corresponding DDL/DML script for reproducing.

In case of >2MB attachment, we recommend either using some file exchange server (send us the corresponding link) or uploading a test project to our FTP server (the credentials will be provided by email request).

Re: Object Null Ref when save changes adding new entity

Posted: Thu 28 Jul 2016 01:22
by thoho
I got supported.

Root cause:
We have reproduced System.NullReferenceException when EF Core logging is enabled (https://docs.efproject.net/en/latest/mi ... gging.html).

Temporary workaround:
Please disable EF Core logging and use the dbMonitor tool (http://www.devart.com/dotconnect/mysql/ ... nitor.html).

Cheers

Re: Object Null Ref when save changes adding new entity

Posted: Thu 11 Aug 2016 15:34
by Shalex
The bug with using EF Core logging is fixed in the newest (8.6.714) build of dotConnect for MySQL.