Please do not reply to this email- if you want to comment on the bug, go to the URL shown below and enter your comments there.
Changed by [EMAIL PROTECTED] http://bugzilla.ximian.com/show_bug.cgi?id=77785 --- shadow/77785 2006-03-15 03:06:21.000000000 -0500 +++ shadow/77785.tmp.14951 2006-03-15 03:07:30.000000000 -0500 @@ -214,6 +214,44 @@ So, we MUST check in SQLSessionHandler the "real" connection state ------- Additional Comments From [EMAIL PROTECTED] 2006-03-15 03:06 ------- Gonzalo, this can't be fixed in System.Data. It's SQLServerSessionState which doesn't check the connection state. + +------- Additional Comments From [EMAIL PROTECTED] 2006-03-15 03:07 ------- +Hubert, you're right that this has to be eventually fixed +in SessionSQLServerHandler, but your patch is horrible. +Please implement 2 methods that check the connection +state and use them in place of the copy&paste patch: + +void ExecuteNonQuery () +{ + try { + if (cnc.State == ConnectionState.Closed) + cnc.Open (); + cnc.ExecuteNonQuery (); + } catch { + cnc.Open (); + cnc.ExecuteNonQuery (); + } +} + +IDataReader ExecuteReader () +{ + try { + if (cnc.State == ConnectionState.Closed) + cnc.Open (); + return cnc.ExecuteReader (); + } catch { + cnc.Open (); + return cnc.ExecuteReader (); + } +} + + +We probably should use the "pooled connection pattern", +but since the connection has to be activated via +reflection, it would introduce some overhead on every +request. It's a shame how M$ did design the session +state :-/ + _______________________________________________ mono-bugs maillist - [email protected] http://lists.ximian.com/mailman/listinfo/mono-bugs
