[freetds] Transaction weirdness

James K. Lowden jklowden at schemamania.org
Fri Oct 10 00:37:19 EDT 2003


On 09 Oct 2003, John Anderson <ardour at semiosix.com> wrote:
> So my code processes the data (1 row) that it needs, and then tries to
> execute the commit. Since the other (useless) resultset is still
> pending, the commit attempt fails.
> 
> Seems to me that from an application point of view it would make sense
> for a commit attempt to automatically cancel any pending result sets?

Philosophically, regardless of what documentation says?  You could take
that point of view, or you could say that an out-of-place commit indicates
a logic flaw in the application, because results have to be fetched or
explicitly cancelled.  

By insisting on explicit handling of the results, the designers prevent
applications from assuming they've fetched all the rows when they haven't.
 Lots of programmers make the mistake at one time or another of assuming a
query will return one row when it actually may return two or more.  This
way at least, the database won't take the heat for the bad assumption.  

--jkl


More information about the FreeTDS mailing list