RefreshRecords

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
llober
Posts: 3
Joined: Wed 07 Nov 2007 21:40

RefreshRecords

Post by llober » Sun 18 Oct 2009 21:28

Hello,

Using SDAC 4.50.0.39 Professional D5.

1. RefreshRecords only works if the MSQuery component has ReadOnly = False ( I will not make updates - because I have established ReadOnly = True - for performance as you state in the documentation - ... but other applications / users can make changes to the data ! I have to do a Full Refresh ).

2. RefreshRecords does not work with fkLookup fields, if Options.CacheCalcFields = True.

My trouble is that locally sorting using IndexFieldNames is extraordinary slow, when the sort field is a fkLookup ( with 5000 records, takes 15 seconds ... ). It seems to me that you're using a very inefficient sort algorithm ( something like performing n*n comparations to sort n records, so with a fkLookup field, this is very slow ... ¿ don't use Quicksort ? ).

So, I have to activate the Options.CacheCalcFields ... and the sort speed with IndexFieldNames is aceptable.

But then, RefreshRecord will not work with the fkLookup Fields if CacheCalcFields is True ... they will show always the old value, not the corresponding to the "Refreshed" version of the record.

Is there any workaround ?

Regards,
Lluis Olle

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Fri 23 Oct 2009 09:46

We have reproduced the problems, and we are working on it. You will be notified when we fix the problems.

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Wed 28 Oct 2009 10:10

If you set ReadOnly to True, TMSQuery does not get the additional information about tables and fields from SQL Server. So TMSQuery cannot generate SQL statement used to select new values for a record.

You can solve this problem in several ways:
1) assing a value to the SQLRefresh property manually;
2) for the latest SDAC build you can assing values to the UpdatingTable and KeyFields properties.

We have fixed the problem with CacheCalcFields. The fix will be included in the next build of SDAC.

Post Reply