Skip to Content.
Sympa Menu

freetds - Re: [freetds] Transaction weirdness

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "James K. Lowden" <jklowden AT schemamania.org>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] Transaction weirdness
  • Date: Thu, 9 Oct 2003 23:37:19 -0400

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




Archive powered by MHonArc 2.6.24.

Top of Page