Hi darrel,
It's not a matter of .Net's cleanup capabilities. It's a matter of the
nature of database connections in .Net. What I mean is that it has nothing
to do with global .Net operations, such as garbage collection. It is
specific to database connections, due to their nature. You will find the
same type of thing with .Net classes that open and close files, and use
unmanaged resources "under the hood". For example, if you open a file, you
had better close it, or it will become unusable (until the next reboot).
Why? Because that's how the file system works. It locks files when they are
opened, and unlocks them when they are closed. A database connection is
similar, in that, you can open it and it will remain open (and in memory)
until you close it. While the connection at your end may be unused when
you're finished using it, it is still connected to the database at the other
end. Closing it disconnects it, allowing it to be cleaned up.
--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living
"darrel" <no*****@hotmail.com> wrote in message
news:u0**************@TK2MSFTNGP12.phx.gbl...
We're running into a problem on our new site. Once a week or so, our site
goes down with an 'out of memory error'. Rebooting the web server fixes
things. Googling the error doesn't return many results (one, actually) and
the suggested fix is to make sure you are manually closing all DB
connections. I'm doing that now, but I had thought that asp.net had fairly
robust automated cleanup, and that having to explicitely close every
connection wasn't necessarily needed (though I certainly agree that it's
good practice). Just curious as to what .net's clean-up capabilities
actually are.
-Darrel