Subject Re: [firebird-support] Re: delayed suspend
Author Helen Borrie
At 11:38 PM 5/06/2009, you wrote:
>Hi Helen, everyone...
> Only to confirm if I was understanding rigth...
>
>let see if I understand right:
>
>> If your application code is fetching the contents of that buffer into its own buffer (as would be the case for a Delphi dataset, unless the FOR UPDATE keyphrase were included in the call) then the SUSPEND ends once the row is fetched into the client buffer and the SP is able to continue executing.
>
> by Delphi dataset, you mean IBXs components (TIBTables, TIBQuerys,...), DBX components (TClientDataset, TSQLTable,...), all TDataset descendents, or also another components (like IBO, FIB+, zeos,MDO,...)?

Yes. (It's not confined to Delphi though...other interface components work with buffered datasets as well.)

> Also this is what we see when use property RecordCount that only count the fetched rows? (if, your table is big and you did only a "dataset.open" is need to do a FetchAll to count all rows)

Generically, yes. Most Delphi components (+ others that can buffer output sets) begin fetching "batches" of rows from the client's buffer, typically as soon as there are enough to fill a grid.

>> If an exception occurs during an iteration of the loop, the SUSPEND doesn't happen and execution passes to the nearest exception
>handler.
>> -- If the loop doesn't provide its own exception handler, the loop stops executing and control passes to the next exception handler....and so on...but the engine has no way to *recall* output rows that have already been fetched or cached by the client.
>
>so if after a error in my SSP "DoSomethingVeryLong_whitoutDistinctGroupByAndEtc"
>the data is blank, then is because the exception handler erased the dataset buffer? (let´s say that the error ocurrs after the suspend take some rows ok?:)

No. Read that para again. Once the rows enter the buffer that the client has set up for them, the engine does not "suck them back", "erase" them, hold its breath and turn blue, etc. An exception handler only operates inside the procedure itself. What happens to the data waiting in the client buffer is entirely under the control of the client application.

./heLen








>------------------------------------
>
>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
>Visit http://www.firebirdsql.org and click the Resources item
>on the main (top) menu. Try Knowledgebase and FAQ links !
>
>Also search the knowledgebases at http://www.ibphoenix.com
>
>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>Yahoo! Groups Links
>
>
>