#1 2015-08-01 16:32:41

Celso
Member
Registered: 2013-05-14
Posts: 55

UpdateFromServer

My application is client / server.
On the side of the client I use TClientDataSet.
I'm trying to do a routine check for updates to the database.

so do:

procedure TForm1.Timer1Timer(Sender: TObject);
var
    v: TSQLTableJSON;
    v1: boolean;
    v2: Rawutf8;
begin
    v1: = True;

    v2: =  DataSetToJSON (MyClientDataSet);

    v: = TSQLTableJSON.Create ('',pointer (v2), length (v2));
    if frmDM.fRestClient.UpdateFromServer ([v], v1) then
         // change records;
end;

Always informs that there was no update, even if another client update a record.

What am I doing wrong?

Offline

#2 2015-08-01 17:46:57

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,207
Website

Re: UpdateFromServer

You are comparing from a local copy of the data.

UpdateFromServer only works when the TSQLTableJSON comes directly from the server.

Offline

#3 2015-08-01 22:21:44

Celso
Member
Registered: 2013-05-14
Posts: 55

Re: UpdateFromServer

Thanks

Offline

#4 2015-08-02 12:56:32

Celso
Member
Registered: 2013-05-14
Posts: 55

Re: UpdateFromServer

Ab,

I'm not getting it.

Please help me give way as I do. I need a routine that, from time to time, check if there are updates on records that users are accessing

Offline

Board footer

Powered by FluxBB