Datasnap in 10.3 Rio incompatible with previous versions

那年仲夏 提交于 2020-01-15 05:48:05

问题


We have a problem with Datasnap RESTfull, it seem to have an incompatibility between 10.3 Rio and 10.2 Tokyo (and all bellow) about Datasnap RESTfull function implementation.

The problem:

We have a server, builded with 10.2 currently running and servicing a lot of users. If we update the server with the one compiled with Delphi 10.3 Rio, the current 10.2 client (Win, MacOS, iOS, Android) receive the following error message: Internal: Field FValue cannot be found in type TJSONString.

Conversly, when we try the client compiled with Delphi 10.3 Rio thru the current server (10.2) running on Amazon AWS, we got the following error message: Internal: Field FStrBuffer cannot be found in type TJSONString.

​The only way to have working system, is to use the 10.3 client with 10.3 server. But, currently, there is a lot of user then we cannot change the server part and expect to have all client (desktop and mobile) to be updated at the same time. ​​

The code on the server :

function TServerMethods1.GetMembers: TFDJSONDataSets;
begin      
  sCurrentDBName := aDBName;   
  FDQueryMEMBERS.Close;   
  Result := TFDJSONDataSets.Create;   
  TFDJSONDataSetsWriter.ListAdd(Result, StrMEMBERS, FDQueryMembers);     
end;

The code on the client :

procedure TMemberServer.GetMembers;
var
  aDataSetLists: TFDJSONDataSets;
begin    
  aDataSetLists := ServerMethods.GetMembers(sDBName);      
  FDMemTableMembers.Active := false;
  FDMemTableMembers.AppendData(TFDJSONDataSetsReader.GetListValue(aDataSetLists, 0));    
end;

Investigation:

In the 10.3 version of System.JSON, FValue is implemented but not FStrBuffer.

In the 10.2 version of System.JSON, FStrBuffer is implemented but not FValue.

Question:

What can we do the keep the current 10.2 user working and also being able to update the server with 10.3 Rio?

Is there another way to implement this function or is there a workaround ?

来源:https://stackoverflow.com/questions/55583298/datasnap-in-10-3-rio-incompatible-with-previous-versions

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!