Subject Re: [IBO] Re: Fw: Keylinks questions
Author Helen Borrie
At 02:22 PM 20/06/2003 +0200, you wrote:
>At 21:27 20.06.2003 +1000, you wrote:
> >a) you don't close ib_cursors. You shouldn't unprepare them if you are
> >likely to use them again. What you *should* do is ensure that you don't
> >keep any transactions open holding cursors that you've finished working
> with.
> >
> >This is starting to turn into a manual! Have you ever thought about
> >working your way through the TI sheets on the web site?
>
>Well, I've already used this "manual" to remove a couple of
>TIB_Cursor.Close statements in one of my programs. Though it did feel a bit
>weird not to close the cursor and just assign another parameter value when
>I didn't know whether it had reached the end or not (doing some reading of
>the first matching record within a loop without caring about whether there
>are more matches or not).

Well, visualise it like this. Let's say you get half-way through the pile
of rows that the server is waiting to dispatch over to you next time you
call Next. If you never call Next and you don't do anything about those
rows over on the server, they will just stay there until you either end the
transaction, or swap them for some different rows. Since there are no
dataset buffers, there's nothing for Close to do. If you hadn't reached
EOF, the row buffer is still "loaded" - but - replacing the params and
calling First puts you back at Ground Zero, with the row buffer data
getting replaced anyway, and a completely new "queue" of rows waiting for
Next...

H.