Master-detail, cached updates and LocalMasterDetail
Posted: Thu 03 Aug 2017 10:36
Scenario: 100K customer (master rows) with an average of 10 contact (detail) rows each... totaling about 1M detail rows.
Without CachedUpdates I set LocalMasterDetail to false, and each time I scroll on the master dataset UniDAC fetches the 10 or so detail rows from the database. I can insert, modify and delete rows and all is done immediately (on Delete or Post).
With CachedUpdates I have to set LocalMasterDetail to true. If I understand correctly, this means UniDAC will fetch 1M detail rows and filter them out locally. In the above scenario this is really not feasible.
I can understand the reasoning behind how it is... UniDAC needs to have all the detail updates cached, and these could be detail rows of more than one master row. But this is just something you cannot do with a big database in a network environment. Too much network traffic and too much time and memory to load all that data in the client application that will probably not need most of it.
My question is... is this how CachedUpdates with a master detail actually works? If so... has anyone suggested to fix and enhance this on UserVoice? I've looked through the suggestions but have not found it.
As to how to fix it... well it is necessary to develop an hybrid solution (like FireDAC seems to do). Fetching should be done on master scroll, on an as needed basis (as when LocalMasterDetail is set to false). But any updates to detail rows need to survive the master scroll and be cached up to the Apply or Cancel updates call. I know that handling the cache this way is complex, but I really see no other way to manage CachedUpdates on a master-detail setup with big RL databases.
TIA for any feedback
Without CachedUpdates I set LocalMasterDetail to false, and each time I scroll on the master dataset UniDAC fetches the 10 or so detail rows from the database. I can insert, modify and delete rows and all is done immediately (on Delete or Post).
With CachedUpdates I have to set LocalMasterDetail to true. If I understand correctly, this means UniDAC will fetch 1M detail rows and filter them out locally. In the above scenario this is really not feasible.
I can understand the reasoning behind how it is... UniDAC needs to have all the detail updates cached, and these could be detail rows of more than one master row. But this is just something you cannot do with a big database in a network environment. Too much network traffic and too much time and memory to load all that data in the client application that will probably not need most of it.
My question is... is this how CachedUpdates with a master detail actually works? If so... has anyone suggested to fix and enhance this on UserVoice? I've looked through the suggestions but have not found it.
As to how to fix it... well it is necessary to develop an hybrid solution (like FireDAC seems to do). Fetching should be done on master scroll, on an as needed basis (as when LocalMasterDetail is set to false). But any updates to detail rows need to survive the master scroll and be cached up to the Apply or Cancel updates call. I know that handling the cache this way is complex, but I really see no other way to manage CachedUpdates on a master-detail setup with big RL databases.
TIA for any feedback