Subject Re: [IBO] Transaction error mystery: suspected IB_Cursor bug
Author Helen Borrie
At 12:50 PM 07-11-02 +0000, you wrote:
> > I just can't see why you have to start and commit a transaction each time
> > you run this query, is all, since you don't appear to be doing any
> > DML.
>
>As far as I know, Interbase needs a transaction even for a SELECT

correct

>(everything is done by interbase inside transactions, apart generators),
>so I only made an explicit control to stop the transaction as soon as possible.

Sure, but you shouldn't stop the transaction if you are still using
it. You don't have to have your workflow going dit-dit-dit in blind
pursuit of shortening transactions. Keep it open until you've finished the
task; just design tasks so that users aren't tempted to leave them unfinished.

>Are you telling me that only for DML there is a need of transaction?

No. I'm sure I didn't imply that. <sigh>

>What about updates upon the same data if a non DML is performed by this
>code, but the transaction is left open?

What (?) about updates? Do you mean, can the user go ahead and perform
updates on data that is otherwise only selected? Or what?


> > Neither do I understand why you close the cursor each time. You
> > simply need to call First to refresh it.
>
>Why left this open? This is code that should run only one time. Happends
>that if the user changes some program configurations, must be done again
>or restart the app (and this is why I discovered this problem only now).

Hmm, from your code example and description, you were starting a
transaction, reading a blob, committing the transaction, then restarting
the transaction, reading another blob, then committing the transaction...


>Could you confirm me that my code is correct and SHOULD work? So is it a
>ib_cursor bug?

Your code should "work" because it doesn't appear to do anything. (I think
I'm getting too tired to drag this out any further....)

goodnight.

Helen