Subject RE: [IBO] Simulating ISAM files using a TIBOTable component
Author Jason Wharton
> I have a need to provide access to a Firebird table in a simulated
> ISAM environment. On the surface it would seem as though the
> TIBOTable would be a perfect foundation on which to base the ISAM
> simulation middleware. I have quite a few concerns regarding
> performance when using the TIBOTable component. For instance:

It is the perfect component to simulate ISAM table access.

> What happens when the transaction is commited? How do I avoid
> fetching the entire table every time I commit while leaving the
> current position of the record pointer intact?

You call InvalidateRows to wipe the buffer clean so that fresh records come
from the server. Or, if you prefer to have changes pro-actively put into
the cache, use DML caching and have it span connections so that updates
records on a record level basis are purged from your cache. This way, you
maintain cached records for better performance but get the benefit of being
"up-to-date" with the database too.

> How do the Find and Locate methods work? It seems that in order to
> allow fetching the table backwards from the located record that the
> table component would need to fetch all records preceeding the located
> record every time I Find or Locate. Doesn't this make the use of
> indexes almost irrelevant?

IBO knows how to jump around and virtualize the buffers.

> I guess most of my concerns stem from really bad experiences with the
> Borland TTable component. I guess that I really want to know if the
> TIBOTable is more efficient that TTable or if it emulates it so
> faithfully that the inefficiencies are also emulated.

If you want the benefit of having records cached in the buffers of a dataset
you must use TIBOTable and get to know it intimately well. This is not an
easy undertaking.

Or, if you want to keep your development work more straight forward, omit
having anything buffered and translate all ISAM record requests into SQL
that will execute via TIB_Cursor. You will be undertaking a very daunting
task here but it will be in the realm of your control and design as to how
it is done.

In short, these are your two choices: Take the time to learn what I've done
and have the benefit of dataset buffer caching or build your own system with
cursors and not have dataset buffer caching. Everything is just plumbed to
the server.

Jason Wharton