0

My name is Stefano Fanti,I am a developer in Plexa.We are actually using your component ( FireDAC ) and I am contacting you in order to solve some problems we have not been able to fix ourself.
In our company we decided to port a legacy 3-Tier DATASNAP application written on Delphi7 for the new environment Delphi XE7 , and we decided to use the new components library FireDAC too. Our application is built in this way: a Client side using TClientDataSet directly connected to the Server side with TDataSetProvider/MIDAS and TTable TQuery TDatabase components (BDE) We replaced BDE components with the related FireDAC ( FDConnection , FDTable and FDQuery ) without issues and we started testing thinking anyway it was not needed to perform it. After some test , a couple of issues have arosen : the first problem is related to the modifications performed on DB ( MS SQL Server ) , the second is related the the reopening of the table after applying the modifications. In our case , the RequestLive=True property ( default ) , does’nt allow to apply modifications ( Post/ApplyUpdates) to the Database. Assigning RequestLive = False , we are able to apply modifications on all table’s records except the first, the last giving us the error .
The above anomaly have been verified on each Database table . However all database tables have the primary key defined properly. Trying to use FireDAC Help I read the option RequestLive=False excludes fiMeta from Fetch,Options, preventing the component to use the primary key of the table, being otherwise seen correctly in any other case. After several trials I found two configurations applied to the Server side, allowing us to achieve the result.

First configuration

  1. FDTable.RequestLive= False
  2. FDTable.UpdateMode = upWhereKeyOnly
  3. with FProvider.DataSet.FieldByName (pkField) do ProviderFlags: = ProviderFlags + [pfInKey];

Second configuration

  1. FDTable.RequestLive= False
  2. FDTable.UpdateMode = upWhereAll
  3. TDataSetProvider.UpdateMode=upWhereAll

The above configurations give us the possibility to apply modifications to tables without errors , but nevertheless don’t allow us to solve the second problem : reopening of the tables for each operation. Indeed , the BeforeOpen and AfterOpen managers are executed each time. What can I do to avoid the Table to be needless reopened after each modification ? Are the configurations used to apply modifications correct , or maybe another solution exist allowing us to avoid code modifications causing us to lengthen development times ?

Thank you in advance for your help.

Best regards Stefano Fanti

  • Have you checked the Updateoptions.RefreshMode property of your table component? – Copilot Apr 16 '15 at 07:02
  • Thanks for your response, yes, the UpdateOptions.RefreshMode i setting in rmManual. – Stefano Fanti Apr 16 '15 at 12:58
  • Stefano you need to work on your question, make it more readable, create a working example and tell what error are you getting. Besides, from what I can tell you saying that you have three problems. This complicate things, you should ask only about one problem per question. – Wodzu Apr 17 '15 at 14:36
  • Thanks for the reply. Create a working example is more difficult because the application is more complex. Is true, there are three problem but the first is the table open after applyupdates. I have tested many firedac configuration but the result is the same. Is this a firedac bug ?. There is any workaround ? – Stefano Fanti Apr 24 '15 at 20:37

0 Answers0