Question

I developed an Client/Server application, using datasnap. I need to know how to refresh the data on the server whenever a client has updated a table. The reason being that when I run a query on the client, after I inserted records into a table, the new records do not reflect in the queries.

Im using a firebird db, with datasnap, developing in Delphi XE2

Was it helpful?

Solution

Put a TTimer control on the client form and specify refreshing time frequency, change interval value as your needs, for example:

procedure TForm1.Timer1Timer(Sender: TObject);
begin
table1.refresh;
end;

OTHER TIPS

I would say, it also depends on tools you are using to write to DB.But, generally, with Firebird, you would Activate a Transaction and once update is done you would then Commit your changes. Prior to committing, no other client can see the new Changes no matter how many times they refresh. Once committed, my understanding would be to say, you would then Refresh you data by merely calling a SELECT command, as per your criteria.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top