I'm using the latest stable MySql Connector/NET 6.5.4.0.
I open a connection to a MySQL database. In the C# code, the Connection.State
property is Open
.
I do some magic stuf, and while I'm doing that, I kill the connection server side. However, in the code the State is still Open
.
I ran into this problem because I save instances of my database class in a static variable per session (Dictionary). If a user does a request, the database class is pulled from this variable, and queries are fired to it. However, if the connection closes server side (killed by de sysadmin, wait timeout elapsed), the state isn't updated.
Is there a workaround for this problem? My colleague allready submitted a bug report for it (http://bugs.mysql.com/bug.php?id=64991).
Close and Open before execution, is very bad for the performance, so no option.