Your Rank: 89
Most of your questions are answered in the wiki: http://docwiki.embarcadero.com/RADStudio/Berlin/en/Tutorial:_Using_a_REST_DataSnap_Server_with_an_Application_and_FireDAC
You should note the following, however
- Server side: Set the FireDAC datasets FetchOptions.Mode to fmAll to ensure that the full result set is transfered to the client
- Client side: Set the FDMemTables CachedUpdates property to true. Otherwise is the ChangeLog not maintained, and the FDMemTables are hence unable to know what has been updated.
- Server side in ServerContainerUnit1: The TDSServerClass components LifeCycle property should be set to Invocation to ensure that the server is stateless. I think you alredy did that?
- Client side in ClientModuleUnit1: Set the DSRestConnection1.PreserveSessionID property to False to prevent the client to re-use session ID's. I thnk you already also did that?
PS: Please note that I am not in any way connected to Embarcadero, except for being a long-time customer :)
Freddy B11742 wrote:
I can recommend using the IcoFX tool developed by IcoFX Software - a small Romanian-based software company.All tasks related to creating icons can be performed using the tool. It is able to create not only icons for use in Windows, but handles icons
Problem solved: When connecting to a stateless DataSnap REST server (i.e. having the TDSServerClass components LifeCycle property set to "Invocation"), the TDSRestConnection components PreserveSessionID should be changed to "False" (it defaults to True).
At the same time, the TDSHTTPWebDispatcher components SessionTimeout could preferably be set to a somewhat lower value than the default of 1200000, resulting in the server preserving the SessionID in 20 minutes.
If you create a stateless REST server clients still can timeout showing the following error message: "HTTP/1.1 403 Session has expired."
The error is shown on the client if a client is left running (just leave the client running without using it) for a longer period than set by the SessionTimeout parameter of the TDSHTTPWebDispatcher component in WebModule1.
The error is shown even if the LifeCycle property of the TDSServerClass is set to 'Invocation', which should result in a stateless server.
I really hope that anyone have a suggestion to cure / work around the problem. Otherwise this is a major issue since stateless REST servers are recommended by Embarcadero for use when connecting from mobile clients because of its better handling of connection issues; however this seams not to be the case.