Implement IDisposable on Enumerble to allow canceling a read.

Description

By putting a IDisposable.Dispose() on the Enumerables (EnumerableImpl?) you can allow for a "break;" in the foreach, and not keep the reader open.

A naive implementation, to demonstrate what I mean.
public void Dispose()
{
_cmd.Cancel(); //canceling the command first prevents the reader from reading to the end. If reader.Close is called on an open ocmmand, it will continue to read all results that are left.
_reader.Close();
}

Suggested by Ingemar Lundberg in sourceforge thread: https://sourceforge.net/forum/forum.php?thread_id=1207753&forum_id=252014

Environment

None

Activity

Show:

MikeM 
February 25, 2005 at 4:29 PM

0.7 was released

MikeM 
January 16, 2005 at 11:56 AM

code was committed.

MikeM 
January 16, 2005 at 8:26 AM

Added test case FooBarTest.EnumerableDispose to duplicate the problem - test failed.

Implemented IDisposable on EnumerableImpl - test passed.

Running entire test suite now before commiting.

Fixed

Details

Assignee

Reporter

Fix versions

Affects versions

Priority

Who's Looking?

Open Who's Looking?
Created January 10, 2005 at 10:57 AM
Updated February 25, 2005 at 4:29 PM
Resolved January 16, 2005 at 11:56 AM
Who's Looking?