Subject Re: Unknown Cursor
Author Marco Menardi
--- In IBObjects@yahoogroups.com, Svein Erling Tysvaer
<svein.erling.tysvaer@k...> wrote:
> At 13:11 28.03.2003 +0000, you wrote:
> >AFAIK, it happens with IB_Curstor if the transaction has not been
> >started before. Unlike IB_Query, IB_Cursor currently does not start
> >the transaction if not started, as Jason explained me in an old post,
> >but I don't remember if what that error raisen.
> >try to always start transaction before use cursors:
>
> WHAT? I use IB_Cursors all the time and never start any transactions.
> Admittedly, I do assign an IB_Transaction to their IB_Transaction
property,
> but never explicitly start that transaction.

mmm. maybe because I use a transaction with autocommit set to false.
No problems with IB_Query, but problems with TIB_Cursor.
I'm sure about what I'm telling because I've fixed the problem with an
explicit transaction start and because was Jason that gave me the answer.
But revisiting his answer, I've discovered that you have to start the
transaction with Sterted := True, since starttransaction is not enough.
Here his answer:
---------------- Jason
Message 21855, Thu Nov 7, 2002 10:37 am
Subject: Re: [IBO] Transaction error mystery: suspected IB_Cursor bug

APIFirst may not make sure there is a transaction handle present.
Calling StartTransaction does not get a handle. Setting Started to
true will
do that.

StartTransaction is purely a behavioral thing for client/side components.
It's your explicit control mechanism, not physical.

I could make it so that it will make sure a handle is present though.
Would
everyone agree this would be a good thing? It would only matter for
methods
like the raw API ones that don't have the overhead of checking for
everything.
---------------- Jason end

regards
Marco Menardi