Info

Hi!

I never used dataabstract(i have license).
So i want to use It now…
I Need to understand some steps.

I have 2 clients connected with server.
I insert new record in client 1 but It doesn t update automatically in client 2. How can i do to update client 2?

Each 1 hour i Need to update database from server side.it Is possible? Or i Need create client side at same server project?

BR,Alessandro

Hi,

Can you specify your platform (Delphi, .NET, Java, JavaScript, Cocoa), pls ?

I m using Delphi Rio 10.3.3

Hi,

you can do it with the table.RefreshFromServer method.

if you want to update only a part of records, you can specify set DynamicWhere expression.

for example, you have the LastUpdated field in table so you can specify a new condition where LastUpdated will be great that specific timestamp.
don’t forget to return DynamicWhere to original state.

Tks…

Server side:
I want to use absolutedb…at server side It possible insert new record? How?

Client side:
So i must implement a ttimer to update table with table.refreshfromserver?
It possible to know if a tablet have new or modified records?

BR,Alessandro

Hi,

you can use any of these workarounds:

  • the same as on client-side via table: TDAMemDataTable should be linked to TDALocalDataAdapter (LDA) in the same was as to TDARemoteDataAdapter (RDA). LDA should be linked to DataService. if you wants to put logic into the same DataService, you may link as LDA.ServiceInstance := Self;.
    After this use usual table.Insert/table.Post;
  • manually, via SQL.
    it can be like
ic := Connection.NewCommand('insert .....', stSQL);
ic.RefreshParams;                     // if needed
ic.ParamByName('...').Value := ...;   // if needed
Connection.BeginTransaction;
try
  ic.Execute;
  Connection.CommitTransaction;
except
  Connection.RollbackTransaction;
exd;

we haven’t done this automatically, so timer solution will work

You can add some custom logic to server to store timestamp of last update from any client.
for example, this method service methods will return this info:

function LastUpdated: TDateTime;

if correspondent value differ on client-side, server has some updates.

by other side, you can store more info on server-side like new/changed/deleted PK and give to client additional info …