You are not logged in.
Pages: 1
Concerning to topic https://synopse.info/forum/viewtopic.php?id=4061
i made some modifications to my code and made the ConnectionProperties a Member of my ViewModel Class. so far so good (german so weit so gut )
Now i made a few tests with TSQLDBZEOSConnectionProperties and have encountered the following problems. (Our Main Database is a MySQL Server !)
Scenario 1
Stop MySQL
Start Service
TSQLDBZEOSConnectionProperties.Create raises Exception - Could not find server. As WorkAround i programmed a function like this
property ConnectionProperties : TSQLDBConnectionProperties read GetConnectionProperties;
function TApplication.GetConnectionProperties: TSQLDBConnectionProperties;
function CreateConnectionProperties: TSQLDBConnectionProperties;
begin
try
exit(TSQLDBZEOSConnectionProperties.Create(TSQLDBZEOSConnectionProperties.URI(dMySQL, FHost + ':' + FPort), FDatabase, FUsername, FPassword));
except
end;
exit(nil);
end;
begin
if not Assigned(FConnectionProperties) then
FConnectionProperties := CreateConnectionProperties;
exit(FConnectionProperties);
end;
Now the Properties are created if Server is startet - else nil is returned.
Scenario 2
Start MySQL
Start Service
Use Service's ConnectionProperties
After a while stop MySQL
Using the *ConnectionProperties.ExecuteInlined* returns "Lost Connection to MySQL Server during query" error as expected.
Now start MySQL again.
Now using *ConnectionProperties.ExecuteInlined* returns "MySQL Server has gone away"
Is there a Auto Reconnect Option ?
Rad Studio 12.1 Santorini
Offline
Ok found a solution in setting ConnectionTimeOutMinutes to a value
Rad Studio 12.1 Santorini
Offline
Pages: 1