Subject | Re: expecting explicit transaction start |
---|---|
Author | ben_sollis |
Post date | 2003-11-21T17:29:45Z |
I'd be tempted to try...
for I := 0 to ComponentCount - 1 do // Iterate
if (Components[I] is TIB_Query) then
with TIB_Query(Components[I]) do
IB_Transaction := ibSourceTrans;
if not ibSourceTrans.InTransaction then
ibSourceTrans.StartTransaction;
for I := 0 to ComponentCount - 1 do // Iterate
if (Components[I] is TIB_Query) then
TIB_Query(Components[I]).Open;
----
My reasoning is this.. I don't know if you can assign another query
to an already started transaction.
HTH
Ben
for I := 0 to ComponentCount - 1 do // Iterate
if (Components[I] is TIB_Query) then
with TIB_Query(Components[I]) do
IB_Transaction := ibSourceTrans;
if not ibSourceTrans.InTransaction then
ibSourceTrans.StartTransaction;
for I := 0 to ComponentCount - 1 do // Iterate
if (Components[I] is TIB_Query) then
TIB_Query(Components[I]).Open;
----
My reasoning is this.. I don't know if you can assign another query
to an already started transaction.
HTH
Ben
--- In IBObjects@yahoogroups.com, "Ed Dressel" <Dressel@A...> wrote:
> I have some simple code that causes the exception
>
> invalid transaction handle (expecting explicit transaction start)
> '. Process stopped. Use Step or Run to continue.
>
> the source code :
>
> ibSourceTrans.StartTransaction;
> try
> for I := 0 to ComponentCount - 1 do // Iterate
> if (Components[I] is TIB_Query) then
> begin
> lIBQ := TIB_Query(Components[I]);
> lIBQ.IB_Transaction := ibSourceTrans;
> lIBQ.Open; //<--- exception raised
> ...
>
> I've run the SQL statement in IBE and it worked fine (a very simple
> select). I am explicitly starting the transaction (a Read only
> transaction)--what should I be doing?
>
> Thanks,
> Ed Dressel
> Ed Dressel