2
votes

I tried transfer of my Project from XE8 to XE10.1

DataSnap Client Module have SQLConnection1: TSQLConnection

When I set property Driver.ConnectTimeout to any value, then set Connected=true, I get error:

"SetConnectTimeout"

Without any value in Driver.ConnectTimeout set connection is OK.

What my error?

1

1 Answers

1
votes

You are not doing anything wrong. Embarcadero did.

In Delphi 10 Seattle (I don't have XE8), the implementation of the Data.DbxHTTPLayer.TDSHTTPNativeClient.SetConnectTimeout method is:

procedure TDSHTTPNativeClient.SetConnectTimeout(AMilisec: Integer);
begin
  FHTTP.ConnectTimeout := AMilisec;
end;

In Delphi 10.1 Berlin, the same method looks like this:

procedure TDSHTTPNativeClient.SetConnectTimeout(AMilisec: Integer);
begin

  raise ENotImplemented.Create('SetConnectTimeout');
end;

I edited the source (Data.DbxHTTPLayer.pas) to:

procedure TDSHTTPNativeClient.SetConnectTimeout(AMilisec: Integer);
begin
  FHTTPClient.ConnectionTimeout := AMilisec;
  //raise ENotImplemented.Create('SetConnectTimeout');
end;

And it solved the problem. The original .dcu and .o initially prevented the change from actually being linked into my app, so I added Data.DbxHTTPLayer.pas to my project (this was probably not the correct way to do it).