* SqlConnection.cs: close the connection on error. svn path=/trunk/mcs/; revision=121920
@@ -1,4 +1,8 @@
+2008-12-20 Gonzalo Paniagua Javier <[email protected]>
+
+ * SqlConnection.cs: close the connection on error.
2008-12-16 Gonzalo Paniagua Javier <[email protected]>
* SqlParameter.cs: don't allocate error strings until the error
@@ -302,6 +302,10 @@ namespace System.Data.SqlClient
private void ErrorHandler (object sender, TdsInternalErrorMessageEventArgs e)
{
+ try {
+ Close ();
+ } catch {
+ }
throw new SqlException (e.Class, e.LineNumber, e.Message, e.Number, e.Procedure, e.Server, "Mono SqlClient Data Provider", e.State);
}