Subject Re: [IBO] TIB_Query.RefreshKeys ignores updates
Author Luiz
From: "VICSER" <vicser@...>
> Situation:
>
> Several separate client computers connected to the
> same database on server.
>
> At one computer TIB_Query (UpdateQuery) performing
> INSERT, UPDATE OR DELETE on table T1.
>
> All other computer have TIB_Query (DisplayQuery) working to
> display data from table T1 by SELECT statment.
>
> The task is DisplayQuery to reflect changes made by UpdateQuery.
> Notifications about changes performed by UpdateQuery are
> sent over TCP/IP through network to all clients interested
> in displaying data. (DML caching is not appropriate for me).
>
> Table is big (up to 100 000 rows) so RefreshKeys or Refresh is
> more preferred method then Close-Open.
>
> Table is like this
>
> CREATE TABLE T1(
> KEYFIELD INTEGER NOT NULL PRIMARY KEY,
> F2 INTEGER,
> F3 CHAR(8)
> ...
> )
>
>
> DisplayQuery.IB_Transaction.Isolation = tiCommitted
> DisplayQuery.KeyLinks[0] = T1.KEYFIELD
> DisplayQuery.KeyLinksAutoDefine = false
> DisplayQuery.FetchWholeRows = false
> DisplayQuery.AutoFetchAll = false
> DisplayQuery.RefreshAction = raKeepDataPos
> DisplayQuery.RequestLive = false
>
> DisplayQuery.SQL = SELECT * FROM T1 WHERE F2=F2_PARAMETER
>
> where F2_PARAMETER is value set in program, but stay intact
> before and after refresh.
>
> UpdateQuery.IB_Transaction.Isolation = tiCommitted
> UpdateQuery.RequestLive = false
>
>
> After INSERT is performed by the UpdateQuery and insert transaction
> commits I'm trying to display changes using DisplayQuery.RefreshKeys.
> But inserted rows are not visible by DisplayQuery until I perform
> Close and Open. Neither DisplayQuery.RefreshAll nor DisplayQuery.Refresh
> doesn't help too.
>
> After UPDATE or DELETE is performed by the UpdateQuery and changes
> are committed, DisplayQuery.RefreshKeys works fine - every changes
> are visible.
>
> The interesting moment is that DisplayQuery.RefreshKeys doesn't
> reflect INSERTs even if DisplayQuery & UpdateQuery are working
> at the same machine and more of that if DisplayQuery & UpdateQuery
> are working at the same program using the same TIB_Connection
> (but using different TIB_Transaction's).

I have noted on latest version of IBO, I don't remember oldest versions,
that I needed to call invalidatesql and next a refresh to do a refresh works
properly.
I had some problems with refresh and I solve this way. I would have to do
some tests to try reproduce the problem again.

Luiz.