Skip to content

Conversation

how02
Copy link

@how02 how02 commented Jul 14, 2016

EntityFrameworkCore wasn't disposing MySqlDataReader because MySqlDataReader doesn't inherit from DbDataReader.
Here is the exception thrown:

Microsoft.EntityFrameworkCore.DbContext:Error: An exception occurred in the database while saving changes.
MySql.Data.MySqlClient.MySqlException: There is already an open DataReader associated with this Connection which must be closed first.
at MySql.Data.MySqlClient.ExceptionInterceptor.Throw(Exception exception)
at MySql.Data.MySqlClient.MySqlCommand.CheckState()
at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior)
at MySql.Data.MySqlClient.MySqlCommand.ExecuteNonQuery()
at MySql.Data.MySqlClient.MySqlTransaction.Commit()
at Microsoft.EntityFrameworkCore.Storage.RelationalTransaction.Commit()
at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.d__1.MoveNext()

This commit fixes the issue.

@SapientGuardian
Copy link
Owner

Nice catch, thanks for the fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants