Skip to Content.
Sympa Menu

freetds - Re: [freetds] Transaction weirdness

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: John Anderson <ardour AT semiosix.com>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] Transaction weirdness
  • Date: Fri, 10 Oct 2003 07:04:21 -0000

On Fri, 2003-10-10 at 05:37, James K. Lowden wrote:
> 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.

Would it be possible to produce a more helpful error message? Like
"COMMIT or ROLLBACK failed - there are pending results"?

bye
John






Archive powered by MHonArc 2.6.24.

Top of Page