NETCore-Snowflake-Framework
NETCore-Snowflake-Framework copied to clipboard
Use MySqlConnector for async I/O
The Repository
code uses ExecuteScalarAsync
. It's a long-standing bug in MySql.Data (bug 70111) that async I/O is not implemented correctly; thus all these methods will actually run synchronously. (See also here and here on Stack Overflow.)
To fix this, you could switch to https://github.com/mysql-net/MySqlConnector, an OSS replacement for MySql.Data that supports true asynchronous I/O; it also has full .NET Standard/.NET Core support.
If you're interested in this, I'd be happy to open a PR.
thanks! but we all use Mysql.Data for a long time, it looks alright, are you sure about this?
I know for a fact that all the ExecuteNonQueryAsync
, ExecuteReaderAsync
etc. methods in MySql.Data don't actually execute asynchronously. (For example, see the bug report I linked above, and notice that there is no implementation of those methods in the repo: https://github.com/mysql/mysql-connector-net/search?q=ExecuteNonQueryAsync.)
If using actual async I/O is important to this project, then you'll need to change MySQL .NET libraries.
thanks a lot! i'll fix it.