[Mono-devel-list] Patch for SqlConnection
Gonzalo Paniagua Javier
gonzalo at ximian.com
Fri Mar 11 13:26:37 EST 2005
On Fri, 2005-03-11 at 12:56 +0530, Sureshkumar T wrote:
> > Attached there's a small patch that adds a finalizer to SqlConnection
> > and moves the 'disposed = true' into the finally in Dispose(bool).
> SqlConnection does not have any unmanaged resources. Hence, IMHO, it is
> not necessary to have finalizer method. We can avoid an overhead to GC.
Then I wonder what a connection to a database is... The problem is that
if the user forgets about calling Close, the connection is never
released from the conneciton pool.
> I donot see the reason to mark disposed to true in case any exception
> occurs while closing the connection.
It's just that 'disposed' will never be true if there's a exception, but
if you don't care about that...
More information about the Mono-devel-list