MySqlConnector
MySqlConnector copied to clipboard
Support disabling stored procedure cache
Based on https://github.com/mysql-net/MySqlConnector/issues/924 and https://github.com/mysql-net/MySqlConnector/issues/1174, there are a small number of users who modify stored procedure definitions in the database at runtime; this can be a problem because MySqlConnector caches the procedure definitions and can invoke them with the wrong parameter types or order.
Connector/NET can disable its procedure cache by setting Procedure Cache Size = 0 in the connection string. MySqlConnector doesn't support that option.
We could add Procedure Cache Size and only support zero vs non-zero (to disable or enable caching, respectively), or add a new Use Procedure Cache = false connection string option (default is true) to enable users to opt out.
This might have a significant impact on performance, so it could be worth testing whether it's even an option people would want to use. If it's too slow if caching is disabled, other workarounds (such as clearing the pool to get the side-effect of clearing the procedure cache) might be a better solution anyway.
Instead of a connection string option, this could be an AppContext switch, although that would make it global instead of local to a specific connection string.