Subject RE: [IBO] Expecting Explicit Transaction Start
Author Jason Wharton
Calling APIFirst does not do anything to trigger "checks" for context.
For example, it doesn't look to see if you have a connection, transaction,
statement handle or even a prepared statement probably.

If you are calling APIFirst then you need to know for sure you have already
done everything necessary so that a call to that API is contextual.

Your exact situation here would be remedied by:

MyCursor.IB_Transaction.Started := true;

Not sure what else you are going to hit up against, but welcome to the deep
see diving arena that IBO affords you anyway.

Jason Wharton

> -----Original Message-----
> From: Jerry Sands [mailto:jsands@...]
> Sent: Tuesday, March 08, 2005 11:01 AM
> To: ibobjects@yahoogroups.com
> Subject: [IBO] Expecting Explicit Transaction Start
>
>
>
> I have had a problem that is driving me crazy. I am using a
> TIB_Cursors and
> connecting its own exclusive transaction to it. The sql is a select
> statement, the transaction is set to TICommited, Autocommit,
> and Read Only.
> I prepare, set a couple parameters, and execute an APIFirst.
> Most of the
> time this code works correctly. But it will at times error
> out with an
> "Invalid Transaction Handle (expecting explicit transaction
> start)" error.
> I assume IBO is handling the transactions here. I have other
> cursors in the
> program that are implemented in the same way and I am getting
> the errors on
> them at times as well.
>
> I am using Delphi 7, Firebird 1.5, and IBO 4.5Ai.
>
> Does anyone have any ideas?
>
> Jerry Sands