Subject [IBO] Re: support for 2 transactions in ib_query
Author Mihai Chezan
--- In, Daniel Rail <daniel@a...> wrote:
> It hasn't been implemented in IBO, and I don't know if Jason will
> implement it.
I'm a little disappointed for that.

> Yes, I do a refresh. If I would have the TIB_Query.FetchWholeRows
> property set to False, I use the method TIB_Query.RefreshKeys(it
> will only refetch the row keys and not the whole row), otherwise I
> use TIB_Query.Refresh.
The problem with refresh is that if a user scrolls the grid from
record 1 to record 500 and you then issue a refresh, all 500 records
will be fetched again. Let's say that every record has 1 KB that means
500 KB for a refresh and let's say 20 users hit the refresh at the
same time resulting in 10 MB of data that is transfered over the
network. If you have a 100 Mbit network that's almost all the capacity
of the network. If at the same time you have other transfers over the
network and the server has to execute other queries from other clients
you get a delay biger than 1 second, a delay that is visible.

> In a multi-user environment, it's almost a requirement to refetch
> the rows(although IBO does have methods already implemented to fetch
> the added/deleted/modified rows as needed, by invalidating the
> buffer). Otherwise, how would you know if someone else has inserted,
> modified or deleted a row, if your result set buffer is only
> synchronized with your changes. Do keep in mind that changes to a
> table is not automatically pushed onto the client, you have to go
> fetch them.
In my application 95% of the time user 1 works on table 1, user 2
works on table 2 ..... so all I would like is the buffer to be
synchronized with my changes.

> And, when opening/refreshing a query, IBO only fetches the rows that
> you currently need and not all the rows, unless you specifically
> request them.
See my first comment on this.

> Read IBO's help for TIB_Query, you'll find some
> information on the different methods that exists on how to refresh
> the rows/buffer of a query, you'll see that some of the methods are
> there just to refresh the buffered rows.
I don't want to refresh the bufferd rows because that data is ok (up
to date for me). What I would like is the ib_query to reflect changes
that I make through it (ib_query.Append, ib_query.Post) which it does
and I would like at the same time to be able to say
ib_transaction.Commit at the modification that I made without
invalidating the cursor opened for the select. This is only posible
by having the select in one transaction and the inser/update/delete
in other.

Thank you for your time and for your answers.