TMSQuery always gets closed and open when used as a source to a ClientDataSet via Provider
Posted: Wed 29 Aug 2018 16:15
I'm facing a behavior which, at first glance, looks incorrect (to me, at least).
I have a TMSQuery which is used to capture data in a form. Doing modifications, I'm adding a Provider associated to this TMSQuery and a ClientDataSet associated to this provider.
The TMSQuery is active and have updates in cache. Under some circumstances, I'm trying to pull data from the TMSQuery to the ClientDataSet calling Close/Open over it.
The result is the underlying TMSQuery gots closed and re-opened, losing all the updates that was introduced since the last refresh.
I've used this approach in the past using different data access component, and it worked, except on SDAC (and maybe other sister components).
I've narrowed the problem to the implementation of TCustomDADataSet.PSReset method. Comparing the implementation to the one of other TDataSets components included in Delphi like TCustomSQLDataSet, I can see why this is happening.
I'm looking for recommendations to avoid this. I'm not sure to call this a bug, so I'm also interested to see if this is seen as bad here before making a bug report.
I have a TMSQuery which is used to capture data in a form. Doing modifications, I'm adding a Provider associated to this TMSQuery and a ClientDataSet associated to this provider.
The TMSQuery is active and have updates in cache. Under some circumstances, I'm trying to pull data from the TMSQuery to the ClientDataSet calling Close/Open over it.
The result is the underlying TMSQuery gots closed and re-opened, losing all the updates that was introduced since the last refresh.
I've used this approach in the past using different data access component, and it worked, except on SDAC (and maybe other sister components).
I've narrowed the problem to the implementation of TCustomDADataSet.PSReset method. Comparing the implementation to the one of other TDataSets components included in Delphi like TCustomSQLDataSet, I can see why this is happening.
I'm looking for recommendations to avoid this. I'm not sure to call this a bug, so I'm also interested to see if this is seen as bad here before making a bug report.