Subject Re: [IBO] How to detect (Re)Creation of Schema Cache?
Author Dany M
eddiehodad wrote:
> Hi there,
>
> We're in the process of optimising our FB/IBO app for use across
> high-latency (DSL,ADSL) connections.=20
>
> We've figured out that the schema cache plays a big part in startup
> times, with the extra traffic generated if the local cache files are
> deleted or out of date.
>
> To improve the user experience, it'd be great to be able to detect
> when the IBConnection is rebuilding the persistent schema cache, so as
> to be able to show a "Please Wait Seven Minutes" type of dialogue,
> rather than just, you know, having their pc freeze for that long.
>
> The ideal would be an "OnReGenerateSchemaCache" or similar event on
> the IBConnection, but since I cant find anything like that, are there
> any alternatives?

It's been a while since I was into that piece of IBO. What I know from
the top of my head is that the different parts of the cache is loaded at
the time it's needed. This can happen deep inside some activation code
or when you yourself accesses a certain property. If you turn on
"UseServerDefaults" (or some such, I don't remember the name exactly)
that piece of the cache will load on the first Insert. You could run
lots of session without loading it.

Since it happens from so many different places you will be likely to
already have a progress bar running. This may cause problems. It depends
on how you wrote your app, dynamic creation of queries et.c. or
everything static and activated at startup.

Anyway, I don't think there's anything in the present code. You could
try to assign the OnQueryCallback event for the different cursor in the
SchemaCache routines, but that would need a source change and you are
likely to clash with other callbacks (?), see above.

I agree that it would be prudent to have some possibility of user
feedback during the fetching of schemacache information.

Regards,

/Dany