I'm using a seperate task where a new TXDataClient is created, apart from the main thread. I asumed that the TXDataClient isn't thread safe. The loaded TSKbedrijf from the xData server should be available in the main thread after the thread finishes.
Simplified code in the task:
TSKClient := TXDataClient.Create;
TSKbedrijf := TSKClient.Get<Tbedrijven>(id);
As expected, the TSKClient.Free frees TSKbedrijf as well. I found:
TSKClient.ReturnedInstancesOwnership := TInstanceOwnership.None;
but this seems to turn off the client data management for all TXDataClients created. (which makes me think that using this statement isn't thread safe, even though the TSKclientdata is created and destroyed within the thread)
Is there a way to exclude TSKbedrijf from being destroyed automatically? Or is there a way to make the TInstanceOwnership.None only effective for a single TXDataClient?