Subject Re: [IBO] Transaction error mystery: suspected IB_Cursor bug
Author Marco Menardi
--- In IBObjects@y..., Helen Borrie <helebor@t...> wrote:
>
> Marco,
> It's probably a silly question, but what's the point of this block of code?
>
> Helen
Sorry, but I don't speak very well, so I can interprete "point" as a) "position" and b) "purpose".
a) is in a procedure, not in a event
b) in my post (and in my tests) I've taken away non relevant code. The underlaying table is of type "ID, BLOB", so I search for the ID and retrieve the blob to put in a string list. So with the Where part I select only one record, with ApiFirst I "open" the cursor and go there, read the blob, then close. The real code is:
...
crsParamPgm.APIFirst;
crsParamPgm.FieldByName('PARAMETRI').AssignTo(FParamPgm);
crsParamPgm.Close;
...
If you read my second post, you find that clearing the SQL for every use of the cursor eliminates the problem. Another solution that works is set AutoCommit to true and not perform explicit transaction start/commit.
So seems that something in IB_Cursor is not cleared properly when .Cursor is issued (btw, what about a chapter in GSG that describes exactly all the steps for transaction and query/storedproc/cursor usage?).
thanks
Marco Menardi