You are not logged in.
Pages: 1
Hi AB
we got this message yesterday after a mormot service has run about 24 h
The reason seems to be a connection Timeout...
The Problem: it leads to unpredictable result's inserting new records (Exception comes retrieving next ID)
I inserted autoreconnect := true in SynDBFireDAC to test if this helps. May be you have another idea.
constructor TSQLDBFireDACConnection.Create(aProperties: TSQLDBConnectionProperties);
begin
inherited Create(aProperties);
fDatabase := TADConnection.Create(nil);
fDatabase.ResourceOptions.SilentMode := True; // no need for wait cursor
fDatabase.ResourceOptions.AutoReconnect := True; // itSDS Hande Reconnect on e.g. MySQL Server has gone
fDatabase.Params.Text :=
(fProperties as TSQLDBFireDACConnectionProperties).fFireDACOptions.Text;
end;
also i added ping in IsConnected
function TSQLDBFireDACConnection.IsConnected: boolean;
begin
result := Assigned(fDatabase) and fDatabase.Ping and fDatabase.Connected; // ItSDS PING added
end;
Further information can be found here:
http://docwiki.embarcadero.com/RADStudi … _(FireDAC)
Last edited by itSDS (2015-11-12 09:56:15)
Rad Studio 12.1 Santorini
Offline
Thanks for the feedback.
We would include those changes if it helps.
Did you try to use ConnectionTimeOutMinutes property of TSQLDBConnectionProperties ?
This generic property would recreate any connection after an idle period of time, at TSQLDBConnectionProperties level, i.e. for any kind of database access library.
Offline
I'll try - for this test i undocumented my modifications from above.
Rad Studio 12.1 Santorini
Offline
Hi AB, Setting ConnectionTimeOutMinutes works perfekt. I testet it since yesterday
Since then the MySQL was shut down 2 times (for windows update) and the connection was restored automatically.
I'll have an eye on it!
Rad Studio 12.1 Santorini
Offline
Pages: 1