Page 1 of 1

unitable takes too long to refres

Posted: Mon 17 Aug 2015 13:27
by Senad
When I run this query :

Code: Select all

procedure TForm2.cxButton1Click(Sender: TObject);
begin
if (cxLookUpComboBox1.Text = '') or (cxTextEdit1.Text='') then begin
ShowMessage('Niso vpisani vsi potrebni podatki.');
abort;
end else begin
DataModule3.UniQuery2.Close;
DataModule3.UniQuery2.SQL.Clear;
DataModule3.UniQuery2.SQL.Text := ' insert into POSOJA (DVD_ID,OSEBA,DATUM_POSOJE) VALUES (:a1,:a2,:a3)';
DataModule3.UniQuery2.Params.ParamByName('a1').asString := cxLookUpComboBox1.Text;
DataModule3.UniQuery2.Params.ParamByName('a2').asString := cxTextEdit1.Text;
DataModule3.UniQuery2.Params.ParamByName('a3').AsDateTime := Now();
DataModule3.UniQuery2.ExecSQL;

DataModule3.UniQuery2.Close;
DataModule3.UniQuery2.SQL.Clear;
DataModule3.UniQuery2.SQL.Text := 'update filmi set na_voljo=0 where dvd_id=:a1';
DataModule3.UniQuery2.Params.ParamByName('a1').asString := Form2.cxLookupComboBox1.Text;
DataModule3.UniQuery2.ExecSQL;

end;
DataModule3.UniQuery1.Refresh;
DataModule3.UniTable2.Refresh;
DataModule3.UniTable1.Refresh;
end;
It takes 3-4 seconds to execute. The problem, it seems is in the last line
DataModule3.UniTable1.Refresh;
The table refreshing takes too much time (it contains about 2000 records).
Is this normal ?
This is an SQLite database.

Re: unitable takes too long to refres

Posted: Tue 18 Aug 2015 08:17
by MaximG
Unfortunately, we couldn't check the performance of UniTable.Refresh using the provided code. For the following investigation, please send us a small example that demonstrates the problem, including a test DB. You can send to maximg*devart*com