Connection Reset Key—It’s gone. Did anyone hear why?

| 1 Comment | No TrackBacks

So, I asked Microsoft to explain why the ConnectionString dialog exposed by the SqlClient .NET Data Provider no longer has the Connection Reset key. They say it was removed. Has anyone heard why? IMHO, this exacerbates the problem with the Close method. That is, when you use the SqlConnection.Close method in ADO.NET, the connection state is maintained until the next time the connection is used or it times out (4-8 minutes later). I think this is dumb. Why not release the connection state on close? Sure, it’s going to take another round-trip to do so but that can be done in the background asynchronously so the client need not care or even notice that the connection they just closed is being cleaned up and the state they left behind is being flushed. It’s like having a hotel that leaves the dirty sheets on the bed and wet towels on the floor until the next guest tries to get into the room. That’s when the open must be delayed to set the room (or the connection) back to the initial state.

Leaving the state behind means that anything allocated to the Connection is left lying around in memory or on disk getting old and useless. Since they killed the Connection Reset option, it can’t even be used by subsequent connections. I certainly hope the default (and now only) state is “True” (clean on open).

 

No TrackBacks

TrackBack URL: http://betav.com/blogadmin/mt-tb.cgi/2361

1 Comment

Hi Bill,

Is this something you could overcome by calling a finalize() method in a deconstructor for the class wrapping your data connection? Sounds like it might potentially be a garbage collection issue to me.

Of course, your class would have to implement IDisposable, but *shrugs* if it works, then perhaps not such a bad thing?

Cheers

Jeremy H

Pages

Powered by Movable Type 4.21-en

About this Entry

This page contains a single entry by William Vaughn published on March 5, 2009 4:23 PM.

SQL Server Futures Suggestions was the previous entry in this blog.

Progressive Audio Webinar is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.