New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot Open after Dispose #331
Comments
IMHO, the current behavior is correct and superior; the Connector/NET behavior could mask bugs. If someone really wants the Connector/NET behavior, e.g. because they don't want to fix legacy code, perhaps we should add (yet) another connection setting? |
I also agree that MySqlConnector has correct behavior over Connector/NET. This might be something to mention in the migration docs; I don't know if it's worth "fixing" or adding a new connection setting. |
FWIW, I haven't tested Npgsql, but I think updating the documentation is the correct approach here. |
Connector/NET allows the following code:
MySqlConnector throws an
ObjectDisposedException
on the last line.In practice, this could happen if a
MySqlConnection
object was captured by a lambda inside ausing
block, then invoked after the connection is disposed.The text was updated successfully, but these errors were encountered: